Take &mut Diagnostic in emit_diagnostic.
Taking a Diagnostic by move would break the usual pattern `diag.label(..).emit()`.
This commit is contained in:
parent
4767ccec93
commit
056951d628
13 changed files with 43 additions and 41 deletions
|
@ -255,8 +255,8 @@ impl<'mir, 'tcx> Checker<'mir, 'tcx> {
|
|||
// "secondary" errors if they occurred.
|
||||
let secondary_errors = mem::take(&mut self.secondary_errors);
|
||||
if self.error_emitted.is_none() {
|
||||
for error in secondary_errors {
|
||||
self.tcx.sess.diagnostic().emit_diagnostic(&error);
|
||||
for mut error in secondary_errors {
|
||||
self.tcx.sess.diagnostic().emit_diagnostic(&mut error);
|
||||
}
|
||||
} else {
|
||||
assert!(self.tcx.sess.has_errors().is_some());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue