diff options
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/errors.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_session/src/parse.rs | 12 | ||||
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 18 |
3 files changed, 16 insertions, 16 deletions
diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index aab7595ef6e..129ce2679c7 100644 --- a/compiler/rustc_session/src/errors.rs +++ b/compiler/rustc_session/src/errors.rs @@ -17,7 +17,7 @@ impl<'a> IntoDiagnostic<'a> for FeatureGateError { #[track_caller] fn into_diagnostic( self, - handler: &'a rustc_errors::Handler, + handler: &'a rustc_errors::DiagCtxt, ) -> rustc_errors::DiagnosticBuilder<'a, ErrorGuaranteed> { let mut diag = handler.struct_err(self.explain); diag.set_span(self.span); diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 525f00f5cd0..49bac46fc08 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -11,7 +11,7 @@ use crate::lint::{ use rustc_ast::node_id::NodeId; use rustc_data_structures::fx::{FxHashMap, FxHashSet}; use rustc_data_structures::sync::{AppendOnlyVec, Lock, Lrc}; -use rustc_errors::{emitter::SilentEmitter, Handler}; +use rustc_errors::{emitter::SilentEmitter, DiagCtxt}; use rustc_errors::{ fallback_fluent_bundle, Diagnostic, DiagnosticBuilder, DiagnosticId, DiagnosticMessage, ErrorGuaranteed, IntoDiagnostic, MultiSpan, Noted, StashKey, @@ -189,7 +189,7 @@ pub fn add_feature_diagnostics_for_issue( /// Info about a parsing session. pub struct ParseSess { - pub span_diagnostic: Handler, + pub span_diagnostic: DiagCtxt, pub unstable_features: UnstableFeatures, pub config: Cfg, pub check_config: CheckCfg, @@ -227,11 +227,11 @@ impl ParseSess { pub fn new(locale_resources: Vec<&'static str>, file_path_mapping: FilePathMapping) -> Self { let fallback_bundle = fallback_fluent_bundle(locale_resources, false); let sm = Lrc::new(SourceMap::new(file_path_mapping)); - let handler = Handler::with_tty_emitter(Some(sm.clone()), fallback_bundle); + let handler = DiagCtxt::with_tty_emitter(Some(sm.clone()), fallback_bundle); ParseSess::with_span_handler(handler, sm) } - pub fn with_span_handler(handler: Handler, source_map: Lrc<SourceMap>) -> Self { + pub fn with_span_handler(handler: DiagCtxt, source_map: Lrc<SourceMap>) -> Self { Self { span_diagnostic: handler, unstable_features: UnstableFeatures::from_environment(None), @@ -256,8 +256,8 @@ impl ParseSess { pub fn with_silent_emitter(fatal_note: Option<String>) -> Self { let fallback_bundle = fallback_fluent_bundle(Vec::new(), false); let sm = Lrc::new(SourceMap::new(FilePathMapping::empty())); - let fatal_handler = Handler::with_tty_emitter(None, fallback_bundle).disable_warnings(); - let handler = Handler::with_emitter(Box::new(SilentEmitter { fatal_handler, fatal_note })) + let fatal_handler = DiagCtxt::with_tty_emitter(None, fallback_bundle).disable_warnings(); + let handler = DiagCtxt::with_emitter(Box::new(SilentEmitter { fatal_handler, fatal_note })) .disable_warnings(); ParseSess::with_span_handler(handler, sm) } diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 08a9b3d9fa0..d3fbaea84a6 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -22,9 +22,9 @@ use rustc_errors::emitter::{DynEmitter, EmitterWriter, HumanReadableErrorType}; use rustc_errors::json::JsonEmitter; use rustc_errors::registry::Registry; use rustc_errors::{ - error_code, fallback_fluent_bundle, DiagnosticBuilder, DiagnosticId, DiagnosticMessage, - ErrorGuaranteed, FluentBundle, Handler, IntoDiagnostic, LazyFallbackBundle, MultiSpan, Noted, - TerminalUrl, + error_code, fallback_fluent_bundle, DiagCtxt, DiagnosticBuilder, DiagnosticId, + DiagnosticMessage, ErrorGuaranteed, FluentBundle, IntoDiagnostic, LazyFallbackBundle, + MultiSpan, Noted, TerminalUrl, }; use rustc_macros::HashStable_Generic; pub use rustc_span::def_id::StableCrateId; @@ -677,7 +677,7 @@ impl Session { } #[inline] - pub fn diagnostic(&self) -> &Handler { + pub fn diagnostic(&self) -> &DiagCtxt { &self.parse_sess.span_diagnostic } @@ -1416,7 +1416,7 @@ pub fn build_session( ); let emitter = default_emitter(&sopts, registry, source_map.clone(), bundle, fallback_bundle); - let mut span_diagnostic = Handler::with_emitter(emitter) + let mut span_diagnostic = DiagCtxt::with_emitter(emitter) .with_flags(sopts.unstable_opts.diagnostic_handler_flags(can_emit_warnings)); if let Some(ice_file) = ice_file { span_diagnostic = span_diagnostic.with_ice_file(ice_file); @@ -1725,15 +1725,15 @@ enum IncrCompSession { InvalidBecauseOfErrors { session_directory: PathBuf }, } -/// A wrapper around an [`Handler`] that is used for early error emissions. +/// A wrapper around an [`DiagCtxt`] that is used for early error emissions. pub struct EarlyErrorHandler { - handler: Handler, + handler: DiagCtxt, } impl EarlyErrorHandler { pub fn new(output: ErrorOutputType) -> Self { let emitter = mk_emitter(output); - Self { handler: Handler::with_emitter(emitter) } + Self { handler: DiagCtxt::with_emitter(emitter) } } pub fn abort_if_errors(&self) { @@ -1747,7 +1747,7 @@ impl EarlyErrorHandler { self.handler.abort_if_errors(); let emitter = mk_emitter(output); - self.handler = Handler::with_emitter(emitter); + self.handler = DiagCtxt::with_emitter(emitter); } #[allow(rustc::untranslatable_diagnostic)] |
