Skip to content

Commit 0915f7d

Browse files
committed
Auto merge of #119063 - nnethercote:dcx, r=compiler-errors
Consistent `Handler` naming This PR implements the renaming described in rust-lang/compiler-team#699. r? `@compiler-errors`
2 parents 537b8a3 + 3db34ff commit 0915f7d

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

clippy_lints/src/doc/needless_doctest_main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use clippy_utils::diagnostics::span_lint;
66
use rustc_ast::{CoroutineKind, Fn, FnRetTy, Item, ItemKind};
77
use rustc_data_structures::sync::Lrc;
88
use rustc_errors::emitter::EmitterWriter;
9-
use rustc_errors::Handler;
9+
use rustc_errors::DiagCtxt;
1010
use rustc_lint::LateContext;
1111
use rustc_parse::maybe_new_parser_from_source_str;
1212
use rustc_parse::parser::ForceCollect;
@@ -45,10 +45,10 @@ pub fn check(
4545
let fallback_bundle =
4646
rustc_errors::fallback_fluent_bundle(rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), false);
4747
let emitter = EmitterWriter::new(Box::new(io::sink()), fallback_bundle);
48-
let handler = Handler::with_emitter(Box::new(emitter)).disable_warnings();
49-
#[expect(clippy::arc_with_non_send_sync)] // `Lrc` is expected by with_span_handler
48+
let dcx = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings();
49+
#[expect(clippy::arc_with_non_send_sync)] // `Lrc` is expected by with_dcx
5050
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
51-
let sess = ParseSess::with_span_handler(handler, sm);
51+
let sess = ParseSess::with_dcx(dcx, sm);
5252

5353
let mut parser = match maybe_new_parser_from_source_str(&sess, filename, code) {
5454
Ok(p) => p,

src/driver.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ extern crate rustc_span;
1818
use rustc_interface::interface;
1919
use rustc_session::config::ErrorOutputType;
2020
use rustc_session::parse::ParseSess;
21-
use rustc_session::EarlyErrorHandler;
21+
use rustc_session::EarlyDiagCtxt;
2222
use rustc_span::symbol::Symbol;
2323

2424
use std::env;
@@ -174,9 +174,9 @@ const BUG_REPORT_URL: &str = "https://github.com/rust-lang/rust-clippy/issues/ne
174174
#[allow(clippy::too_many_lines)]
175175
#[allow(clippy::ignored_unit_patterns)]
176176
pub fn main() {
177-
let handler = EarlyErrorHandler::new(ErrorOutputType::default());
177+
let early_dcx = EarlyDiagCtxt::new(ErrorOutputType::default());
178178

179-
rustc_driver::init_rustc_env_logger(&handler);
179+
rustc_driver::init_rustc_env_logger(&early_dcx);
180180

181181
let using_internal_features = rustc_driver::install_ice_hook(BUG_REPORT_URL, |handler| {
182182
// FIXME: this macro calls unwrap internally but is called in a panicking context! It's not

0 commit comments

Comments
 (0)