From 55bafab56604c09da647e7a1287edef1e310e0ef Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Mon, 18 Dec 2023 08:59:22 +1100 Subject: [PATCH] Rename `UnstableOptions::diagnostic_handler_flags` as `UnstableOptions::dcx_flags`. --- compiler/rustc_session/src/config.rs | 2 +- compiler/rustc_session/src/session.rs | 2 +- src/librustdoc/core.rs | 3 +-- 3 files changed, 3 insertions(+), 4 deletions(-) diff --git a/compiler/rustc_session/src/config.rs b/compiler/rustc_session/src/config.rs index 9d9530aa3d3..d6bbb76e19a 100644 --- a/compiler/rustc_session/src/config.rs +++ b/compiler/rustc_session/src/config.rs @@ -1155,7 +1155,7 @@ impl Options { } impl UnstableOptions { - pub fn diagnostic_handler_flags(&self, can_emit_warnings: bool) -> DiagCtxtFlags { + pub fn dcx_flags(&self, can_emit_warnings: bool) -> DiagCtxtFlags { DiagCtxtFlags { can_emit_warnings, treat_err_as_bug: self.treat_err_as_bug, diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index e52e75e8c07..08190e1fff0 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -1417,7 +1417,7 @@ pub fn build_session( let emitter = default_emitter(&sopts, registry, source_map.clone(), bundle, fallback_bundle); let mut span_diagnostic = DiagCtxt::with_emitter(emitter) - .with_flags(sopts.unstable_opts.diagnostic_handler_flags(can_emit_warnings)); + .with_flags(sopts.unstable_opts.dcx_flags(can_emit_warnings)); if let Some(ice_file) = ice_file { span_diagnostic = span_diagnostic.with_ice_file(ice_file); } diff --git a/src/librustdoc/core.rs b/src/librustdoc/core.rs index 8cac1df38e2..b8567aa9a89 100644 --- a/src/librustdoc/core.rs +++ b/src/librustdoc/core.rs @@ -169,8 +169,7 @@ pub(crate) fn new_handler( } }; - rustc_errors::DiagCtxt::with_emitter(emitter) - .with_flags(unstable_opts.diagnostic_handler_flags(true)) + rustc_errors::DiagCtxt::with_emitter(emitter).with_flags(unstable_opts.dcx_flags(true)) } /// Parse, resolve, and typecheck the given crate.