diff options
Diffstat (limited to 'compiler/rustc_session/src')
| -rw-r--r-- | compiler/rustc_session/src/errors.rs | 9 | ||||
| -rw-r--r-- | compiler/rustc_session/src/parse.rs | 14 | ||||
| -rw-r--r-- | compiler/rustc_session/src/session.rs | 18 |
3 files changed, 12 insertions, 29 deletions
diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index 8ab31f6f382..9f7d918d98b 100644 --- a/compiler/rustc_session/src/errors.rs +++ b/compiler/rustc_session/src/errors.rs @@ -4,8 +4,7 @@ use crate::parse::ParseSess; use rustc_ast::token; use rustc_ast::util::literal::LitError; use rustc_errors::{ - error_code, DiagCtxt, DiagnosticBuilder, DiagnosticMessage, ErrorGuaranteed, IntoDiagnostic, - Level, MultiSpan, + error_code, DiagCtxt, DiagnosticBuilder, DiagnosticMessage, IntoDiagnostic, Level, MultiSpan, }; use rustc_macros::Diagnostic; use rustc_span::{BytePos, Span, Symbol}; @@ -18,11 +17,7 @@ pub struct FeatureGateError { impl<'a> IntoDiagnostic<'a> for FeatureGateError { #[track_caller] - fn into_diagnostic( - self, - dcx: &'a DiagCtxt, - level: Level, - ) -> DiagnosticBuilder<'a, ErrorGuaranteed> { + fn into_diagnostic(self, dcx: &'a DiagCtxt, level: Level) -> DiagnosticBuilder<'a> { let mut diag = DiagnosticBuilder::new(dcx, level, self.explain); diag.set_span(self.span); diag.code(error_code!(E0658)); diff --git a/compiler/rustc_session/src/parse.rs b/compiler/rustc_session/src/parse.rs index b33cc83f9cf..52a637b74e7 100644 --- a/compiler/rustc_session/src/parse.rs +++ b/compiler/rustc_session/src/parse.rs @@ -83,7 +83,7 @@ pub fn feature_err( feature: Symbol, span: impl Into<MultiSpan>, explain: impl Into<DiagnosticMessage>, -) -> DiagnosticBuilder<'_, ErrorGuaranteed> { +) -> DiagnosticBuilder<'_> { feature_err_issue(sess, feature, span, GateIssue::Language, explain) } @@ -98,7 +98,7 @@ pub fn feature_err_issue( span: impl Into<MultiSpan>, issue: GateIssue, explain: impl Into<DiagnosticMessage>, -) -> DiagnosticBuilder<'_, ErrorGuaranteed> { +) -> DiagnosticBuilder<'_> { let span = span.into(); // Cancel an earlier warning for this same error, if it exists. @@ -318,10 +318,7 @@ impl ParseSess { } #[track_caller] - pub fn create_err<'a>( - &'a self, - err: impl IntoDiagnostic<'a>, - ) -> DiagnosticBuilder<'a, ErrorGuaranteed> { + pub fn create_err<'a>(&'a self, err: impl IntoDiagnostic<'a>) -> DiagnosticBuilder<'a> { err.into_diagnostic(&self.dcx, Level::Error { lint: false }) } @@ -371,10 +368,7 @@ impl ParseSess { #[rustc_lint_diagnostics] #[track_caller] - pub fn struct_err( - &self, - msg: impl Into<DiagnosticMessage>, - ) -> DiagnosticBuilder<'_, ErrorGuaranteed> { + pub fn struct_err(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_> { self.dcx.struct_err(msg) } diff --git a/compiler/rustc_session/src/session.rs b/compiler/rustc_session/src/session.rs index 358219c630f..fc006e4e9d1 100644 --- a/compiler/rustc_session/src/session.rs +++ b/compiler/rustc_session/src/session.rs @@ -354,7 +354,7 @@ impl Session { &self, sp: S, msg: impl Into<DiagnosticMessage>, - ) -> DiagnosticBuilder<'_, ErrorGuaranteed> { + ) -> DiagnosticBuilder<'_> { self.dcx().struct_span_err(sp, msg) } #[rustc_lint_diagnostics] @@ -364,16 +364,13 @@ impl Session { sp: S, msg: impl Into<DiagnosticMessage>, code: DiagnosticId, - ) -> DiagnosticBuilder<'_, ErrorGuaranteed> { + ) -> DiagnosticBuilder<'_> { self.dcx().struct_span_err_with_code(sp, msg, code) } // FIXME: This method should be removed (every error should have an associated error code). #[rustc_lint_diagnostics] #[track_caller] - pub fn struct_err( - &self, - msg: impl Into<DiagnosticMessage>, - ) -> DiagnosticBuilder<'_, ErrorGuaranteed> { + pub fn struct_err(&self, msg: impl Into<DiagnosticMessage>) -> DiagnosticBuilder<'_> { self.parse_sess.struct_err(msg) } #[track_caller] @@ -382,7 +379,7 @@ impl Session { &self, msg: impl Into<DiagnosticMessage>, code: DiagnosticId, - ) -> DiagnosticBuilder<'_, ErrorGuaranteed> { + ) -> DiagnosticBuilder<'_> { self.dcx().struct_err_with_code(msg, code) } #[rustc_lint_diagnostics] @@ -463,10 +460,7 @@ impl Session { self.dcx().err(msg) } #[track_caller] - pub fn create_err<'a>( - &'a self, - err: impl IntoDiagnostic<'a>, - ) -> DiagnosticBuilder<'a, ErrorGuaranteed> { + pub fn create_err<'a>(&'a self, err: impl IntoDiagnostic<'a>) -> DiagnosticBuilder<'a> { self.parse_sess.create_err(err) } #[track_caller] @@ -474,7 +468,7 @@ impl Session { &'a self, err: impl IntoDiagnostic<'a>, feature: Symbol, - ) -> DiagnosticBuilder<'a, ErrorGuaranteed> { + ) -> DiagnosticBuilder<'a> { let mut err = self.parse_sess.create_err(err); if err.code.is_none() { err.code = std::option::Option::Some(error_code!(E0658)); |
