about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2022-03-20 18:26:09 +0100
committerCamille GILLOT <gillot.camille@gmail.com>2022-03-20 20:36:08 +0100
commit94c727eccf0d8befe27aca4050cbb880a6e0343b (patch)
tree4490c853a95a35fb521d50a6563e7aa3ad275d17
parent1f069c0ce7a2b0f48a9bae66fb201f4955836762 (diff)
downloadrust-94c727eccf0d8befe27aca4050cbb880a6e0343b.tar.gz
rust-94c727eccf0d8befe27aca4050cbb880a6e0343b.zip
Take &mut Diagnostic in emit_diagnostic.
Taking a Diagnostic by move would break the usual pattern
`diag.label(..).emit()`.
-rw-r--r--src/driver.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/driver.rs b/src/driver.rs
index 8f8f1140a3d..855a6a6ef6a 100644
--- a/src/driver.rs
+++ b/src/driver.rs
@@ -178,8 +178,8 @@ fn report_clippy_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 version_info = rustc_tools_util::get_version_info!();