diff options
| author | bors <bors@rust-lang.org> | 2024-06-18 16:49:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2024-06-18 16:49:19 +0000 |
| commit | dd104ef16315e2387fe94e8c43eb5a66e3dbd660 (patch) | |
| tree | bc7569f842f9454815433b814d6cdf846f91948b /compiler/rustc_interface/src/interface.rs | |
| parent | 8814b926f49bc5780753ed9533853679a1181357 (diff) | |
| parent | 3f34196839730cfb5b241667cfcc9b94599ea0c1 (diff) | |
| download | rust-dd104ef16315e2387fe94e8c43eb5a66e3dbd660.tar.gz rust-dd104ef16315e2387fe94e8c43eb5a66e3dbd660.zip | |
Auto merge of #126623 - oli-obk:do_not_count_errors, r=davidtwco
Replace all `&DiagCtxt` with a `DiagCtxtHandle<'_>` wrapper type r? `@davidtwco` This paves the way for tracking more state (e.g. error tainting) in the diagnostic context handle Basically I will add a field to the `DiagCtxtHandle` that refers back to the `InferCtxt`'s (and others) `Option<ErrorHandled>`, allowing us to immediately taint these contexts when emitting an error and not needing manual tainting anymore (which is easy to forget and we don't do in general anyway)
Diffstat (limited to 'compiler/rustc_interface/src/interface.rs')
| -rw-r--r-- | compiler/rustc_interface/src/interface.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/compiler/rustc_interface/src/interface.rs b/compiler/rustc_interface/src/interface.rs index c95a10f4e8d..41c8b941717 100644 --- a/compiler/rustc_interface/src/interface.rs +++ b/compiler/rustc_interface/src/interface.rs @@ -9,7 +9,7 @@ use rustc_data_structures::jobserver; use rustc_data_structures::stable_hasher::StableHasher; use rustc_data_structures::sync::Lrc; use rustc_errors::registry::Registry; -use rustc_errors::{DiagCtxt, ErrorGuaranteed}; +use rustc_errors::{DiagCtxtHandle, ErrorGuaranteed}; use rustc_lint::LintStore; use rustc_middle::ty; use rustc_middle::ty::CurrentGcx; @@ -46,7 +46,7 @@ pub struct Compiler { } /// Converts strings provided as `--cfg [cfgspec]` into a `Cfg`. -pub(crate) fn parse_cfg(dcx: &DiagCtxt, cfgs: Vec<String>) -> Cfg { +pub(crate) fn parse_cfg(dcx: DiagCtxtHandle<'_>, cfgs: Vec<String>) -> Cfg { cfgs.into_iter() .map(|s| { let psess = ParseSess::with_silent_emitter( @@ -105,7 +105,7 @@ pub(crate) fn parse_cfg(dcx: &DiagCtxt, cfgs: Vec<String>) -> Cfg { } /// Converts strings provided as `--check-cfg [specs]` into a `CheckCfg`. -pub(crate) fn parse_check_cfg(dcx: &DiagCtxt, specs: Vec<String>) -> CheckCfg { +pub(crate) fn parse_check_cfg(dcx: DiagCtxtHandle<'_>, specs: Vec<String>) -> CheckCfg { // If any --check-cfg is passed then exhaustive_values and exhaustive_names // are enabled by default. let exhaustive_names = !specs.is_empty(); @@ -451,12 +451,12 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se codegen_backend.init(&sess); - let cfg = parse_cfg(&sess.dcx(), config.crate_cfg); + let cfg = parse_cfg(sess.dcx(), config.crate_cfg); let mut cfg = config::build_configuration(&sess, cfg); util::add_configuration(&mut cfg, &mut sess, &*codegen_backend); sess.psess.config = cfg; - let mut check_cfg = parse_check_cfg(&sess.dcx(), config.crate_check_cfg); + let mut check_cfg = parse_check_cfg(sess.dcx(), config.crate_check_cfg); check_cfg.fill_well_known(&sess.target); sess.psess.check_config = check_cfg; @@ -529,7 +529,7 @@ pub fn run_compiler<R: Send>(config: Config, f: impl FnOnce(&Compiler) -> R + Se } pub fn try_print_query_stack( - dcx: &DiagCtxt, + dcx: DiagCtxtHandle<'_>, num_frames: Option<usize>, file: Option<std::fs::File>, ) { |
