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 4767ccec93
commit 056951d628
13 changed files with 43 additions and 41 deletions

View file

@ -1181,8 +1181,8 @@ pub fn report_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
// a .span_bug or .bug call has already printed what
// it wants to print.
if !info.payload().is::<rustc_errors::ExplicitBug>() {
let d = rustc_errors::Diagnostic::new(rustc_errors::Level::Bug, "unexpected panic");
handler.emit_diagnostic(&d);
let mut d = rustc_errors::Diagnostic::new(rustc_errors::Level::Bug, "unexpected panic");
handler.emit_diagnostic(&mut d);
}
let mut xs: Vec<Cow<'static, str>> = vec![