Skip to content

Commit 97839c0

Browse files
committed
Make errors::Handler::cancel() take an immutable reference.
This allows to cancel an error with only an immutable access to the `Handler`. Mutable access is already not required to emit an error anyway.
1 parent 096ed00 commit 97839c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/libsyntax/errors/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ impl Handler {
496496
DiagnosticBuilder::new(self, Level::Fatal, msg)
497497
}
498498

499-
pub fn cancel(&mut self, err: &mut DiagnosticBuilder) {
499+
pub fn cancel(&self, err: &mut DiagnosticBuilder) {
500500
if err.level == Level::Error || err.level == Level::Fatal {
501501
assert!(self.has_errors());
502502
self.err_count.set(self.err_count.get() - 1);

0 commit comments

Comments
 (0)