Skip to content

Commit

Permalink
Auto merge of rust-lang#95149 - cjgillot:once-diag, r=estebank
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
bors committed Mar 26, 2022
2 parents b7b0dad + 94c727e commit 2d85270
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/driver.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!();
Expand Down

0 comments on commit 2d85270

Please sign in to comment.