diff options
| author | Jubilee <46493976+workingjubilee@users.noreply.github.com> | 2023-12-14 16:07:48 -0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2023-12-14 16:07:48 -0800 |
| commit | 9e872b7cd8cd28314b9426e13ac586dad6fc9c2e (patch) | |
| tree | 33b238d5fc9b8970f6a89273089982dd0bd7ce56 /compiler/rustc_session | |
| parent | 576a74b8c9dc72704309db8fc12a2f1ca1cd7c59 (diff) | |
| parent | 9a7841251115c79fe7e1c12e2e5d637e19ad940a (diff) | |
| download | rust-9e872b7cd8cd28314b9426e13ac586dad6fc9c2e.tar.gz rust-9e872b7cd8cd28314b9426e13ac586dad6fc9c2e.zip | |
Rollup merge of #118933 - nnethercote:cleanup-errors-even-more, r=compiler-errors
Cleanup errors handlers even more A sequel to #118587. r? `@compiler-errors`
Diffstat (limited to 'compiler/rustc_session')
| -rw-r--r-- | compiler/rustc_session/src/errors.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_session/src/parse.rs | 11 | ||||
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 2 |
3 files changed, 3 insertions, 12 deletions
diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index 7eed59709c8..aab7595ef6e 100644 --- a/compiler/rustc_session/src/errors.rs +++ b/compiler/rustc_session/src/errors.rs @@ -19,7 +19,7 @@ impl<'a> IntoDiagnostic<'a> for FeatureGateError { self, handler: &'a rustc_errors::Handler, ) -> rustc_errors::DiagnosticBuilder<'a, ErrorGuaranteed> { - let mut diag = handler.struct_diagnostic(self.explain); + let mut diag = handler.struct_err(self.explain); diag.set_span(self.span); diag.code(error_code!(E0658)); diag diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index 881e1de6755..525f00f5cd0 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -14,7 +14,7 @@ use rustc_data_structures::sync::{AppendOnlyVec, Lock, Lrc}; use rustc_errors::{emitter::SilentEmitter, Handler}; use rustc_errors::{ fallback_fluent_bundle, Diagnostic, DiagnosticBuilder, DiagnosticId, DiagnosticMessage, - EmissionGuarantee, ErrorGuaranteed, IntoDiagnostic, MultiSpan, Noted, StashKey, + ErrorGuaranteed, IntoDiagnostic, MultiSpan, Noted, StashKey, }; use rustc_feature::{find_feature_issue, GateIssue, UnstableFeatures}; use rustc_span::edition::Edition; @@ -390,13 +390,4 @@ impl ParseSess { pub fn struct_fatal(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_, !> { self.span_diagnostic.struct_fatal(msg) } - - #[rustc_lint_diagnostics] - #[track_caller] - pub fn struct_diagnostic<G: EmissionGuarantee>( - &self, - msg: impl Into<DiagnosticMessage>, - ) -> DiagnosticBuilder<'_, G> { - self.span_diagnostic.struct_diagnostic(msg) - } } diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 69b861ea380..08a9b3d9fa0 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -632,7 +632,7 @@ impl Session { pub fn span_delayed_bug<S: Into<MultiSpan>>( &self, sp: S, - msg: impl Into<String>, + msg: impl Into<DiagnosticMessage>, ) -> ErrorGuaranteed { self.diagnostic().span_delayed_bug(sp, msg) } |
