Rename many DiagCtxt and EarlyDiagCtxt locals.

This commit is contained in:
Nicholas Nethercote 2023-12-18 11:15:13 +11:00
parent bc3a3bcf0c
commit d165a38de0
2 changed files with 4 additions and 4 deletions

View File

@ -45,10 +45,10 @@ fn check_code_sample(code: String, edition: Edition, ignore: bool) -> (bool, Vec
let fallback_bundle = let fallback_bundle =
rustc_errors::fallback_fluent_bundle(rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), false); rustc_errors::fallback_fluent_bundle(rustc_driver::DEFAULT_LOCALE_RESOURCES.to_vec(), false);
let emitter = EmitterWriter::new(Box::new(io::sink()), fallback_bundle); let emitter = EmitterWriter::new(Box::new(io::sink()), fallback_bundle);
let handler = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings(); let dcx = DiagCtxt::with_emitter(Box::new(emitter)).disable_warnings();
#[expect(clippy::arc_with_non_send_sync)] // `Lrc` is expected by with_dcx #[expect(clippy::arc_with_non_send_sync)] // `Lrc` is expected by with_dcx
let sm = Lrc::new(SourceMap::new(FilePathMapping::empty())); let sm = Lrc::new(SourceMap::new(FilePathMapping::empty()));
let sess = ParseSess::with_dcx(handler, sm); let sess = ParseSess::with_dcx(dcx, sm);
let mut parser = match maybe_new_parser_from_source_str(&sess, filename, code) { let mut parser = match maybe_new_parser_from_source_str(&sess, filename, code) {
Ok(p) => p, Ok(p) => p,

View File

@ -174,9 +174,9 @@ fn display_help() {
#[allow(clippy::too_many_lines)] #[allow(clippy::too_many_lines)]
#[allow(clippy::ignored_unit_patterns)] #[allow(clippy::ignored_unit_patterns)]
pub fn main() { pub fn main() {
let handler = EarlyDiagCtxt::new(ErrorOutputType::default()); let early_dcx = EarlyDiagCtxt::new(ErrorOutputType::default());
rustc_driver::init_rustc_env_logger(&handler); rustc_driver::init_rustc_env_logger(&early_dcx);
let using_internal_features = rustc_driver::install_ice_hook(BUG_REPORT_URL, |handler| { let using_internal_features = rustc_driver::install_ice_hook(BUG_REPORT_URL, |handler| {
// FIXME: this macro calls unwrap internally but is called in a panicking context! It's not // FIXME: this macro calls unwrap internally but is called in a panicking context! It's not