Split Handler::emit_diagnostic in two.
Currently, `emit_diagnostic` takes `&mut self`. This commit changes it so `emit_diagnostic` takes `self` and the new `emit_diagnostic_without_consuming` function takes `&mut self`. I find the distinction useful. The former case is much more common, and avoids a bunch of `mut` and `&mut` occurrences. We can also restrict the latter with `pub(crate)` which is nice.
This commit is contained in:
@@ -581,7 +581,7 @@ impl Emitter for SilentEmitter {
|
||||
if let Some(ref note) = self.fatal_note {
|
||||
d.note(note.clone());
|
||||
}
|
||||
self.fatal_handler.emit_diagnostic(&mut d);
|
||||
self.fatal_handler.emit_diagnostic(d);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user