diff options
| author | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-22 12:36:01 +1100 |
|---|---|---|
| committer | Nicholas Nethercote <n.nethercote@gmail.com> | 2024-02-22 13:47:30 +1100 |
| commit | 02423a5747f4b23cf1e4f51e5ec969887bf8be72 (patch) | |
| tree | 9cddbea2e3108ceaebc21d57aeb6817ae35d3a55 /compiler/rustc_session/src/errors.rs | |
| parent | 326b44e4d371644e8d48469087d763085b6c7711 (diff) | |
| download | rust-02423a5747f4b23cf1e4f51e5ec969887bf8be72.tar.gz rust-02423a5747f4b23cf1e4f51e5ec969887bf8be72.zip | |
Make some `IntoDiagnostic` impls generic.
PR #119097 made the decision to make all `IntoDiagnostic` impls generic, because this allowed a bunch of nice cleanups. But four hand-written impls were unintentionally overlooked. This commit makes them generic.
Diffstat (limited to 'compiler/rustc_session/src/errors.rs')
| -rw-r--r-- | compiler/rustc_session/src/errors.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_session/src/errors.rs b/compiler/rustc_session/src/errors.rs index de7e04ba00f..73373e9ba58 100644 --- a/compiler/rustc_session/src/errors.rs +++ b/compiler/rustc_session/src/errors.rs @@ -3,8 +3,8 @@ use std::num::NonZero; use rustc_ast::token; use rustc_ast::util::literal::LitError; use rustc_errors::{ - codes::*, DiagCtxt, DiagnosticBuilder, DiagnosticMessage, ErrorGuaranteed, IntoDiagnostic, - Level, MultiSpan, + codes::*, DiagCtxt, DiagnosticBuilder, DiagnosticMessage, EmissionGuarantee, ErrorGuaranteed, + IntoDiagnostic, Level, MultiSpan, }; use rustc_macros::Diagnostic; use rustc_span::{Span, Symbol}; @@ -17,9 +17,9 @@ pub struct FeatureGateError { pub explain: DiagnosticMessage, } -impl<'a> IntoDiagnostic<'a> for FeatureGateError { +impl<'a, G: EmissionGuarantee> IntoDiagnostic<'a, G> for FeatureGateError { #[track_caller] - fn into_diagnostic(self, dcx: &'a DiagCtxt, level: Level) -> DiagnosticBuilder<'a> { + fn into_diagnostic(self, dcx: &'a DiagCtxt, level: Level) -> DiagnosticBuilder<'a, G> { DiagnosticBuilder::new(dcx, level, self.explain).with_span(self.span).with_code(E0658) } } |
