Take &mut Diagnostic in emit_diagnostic.

Taking a Diagnostic by move would break the usual pattern
`diag.label(..).emit()`.
This commit is contained in:
Camille GILLOT 2022-03-20 18:26:09 +01:00
parent cce0d50bcb
commit 4f89c51a5b

View File

@ -225,8 +225,10 @@ impl ParseSess {
// Methods that should be restricted within the parse module.
impl ParseSess {
pub(super) fn emit_diagnostics(&self, diagnostics: Vec<Diagnostic>) {
for diagnostic in diagnostics {
self.parse_sess.span_diagnostic.emit_diagnostic(&diagnostic);
for mut diagnostic in diagnostics {
self.parse_sess
.span_diagnostic
.emit_diagnostic(&mut diagnostic);
}
}