Skip to content

Commit 2d85270

Browse files
committed
Auto merge of rust-lang#95149 - cjgillot:once-diag, r=estebank
Remove `Session::one_time_diagnostic` This is untracked mutable state, which modified the behaviour of queries. It was used for 2 things: some full-blown errors, but mostly for lint declaration notes ("the lint level is defined here" notes). It is replaced by the diagnostic deduplication infra which already exists in the diagnostic emitter. A new diagnostic level `OnceNote` is introduced specifically for lint notes, to deduplicate subdiagnostics. As a drive-by, diagnostic emission takes a `&mut` to allow dropping the `SubDiagnostic`s.
2 parents b7b0dad + 94c727e commit 2d85270

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/driver.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,8 @@ fn report_clippy_ice(info: &panic::PanicInfo<'_>, bug_report_url: &str) {
178178
// a .span_bug or .bug call has already printed what
179179
// it wants to print.
180180
if !info.payload().is::<rustc_errors::ExplicitBug>() {
181-
let d = rustc_errors::Diagnostic::new(rustc_errors::Level::Bug, "unexpected panic");
182-
handler.emit_diagnostic(&d);
181+
let mut d = rustc_errors::Diagnostic::new(rustc_errors::Level::Bug, "unexpected panic");
182+
handler.emit_diagnostic(&mut d);
183183
}
184184

185185
let version_info = rustc_tools_util::get_version_info!();

0 commit comments

Comments
 (0)