From 02423a5747f4b23cf1e4f51e5ec969887bf8be72 Mon Sep 17 00:00:00 2001 From: Nicholas Nethercote Date: Thu, 22 Feb 2024 12:36:01 +1100 Subject: 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. --- compiler/rustc_parse/src/errors.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'compiler/rustc_parse/src/errors.rs') diff --git a/compiler/rustc_parse/src/errors.rs b/compiler/rustc_parse/src/errors.rs index 2d4447a42c2..2c76e55a46d 100644 --- a/compiler/rustc_parse/src/errors.rs +++ b/compiler/rustc_parse/src/errors.rs @@ -1073,9 +1073,9 @@ pub(crate) struct ExpectedIdentifier { pub help_cannot_start_number: Option, } -impl<'a> IntoDiagnostic<'a> for ExpectedIdentifier { +impl<'a, G: EmissionGuarantee> IntoDiagnostic<'a, G> for ExpectedIdentifier { #[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> { let token_descr = TokenDescription::from_token(&self.token); let mut diag = DiagnosticBuilder::new( @@ -1133,9 +1133,9 @@ pub(crate) struct ExpectedSemi { pub sugg: ExpectedSemiSugg, } -impl<'a> IntoDiagnostic<'a> for ExpectedSemi { +impl<'a, G: EmissionGuarantee> IntoDiagnostic<'a, G> for ExpectedSemi { #[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> { let token_descr = TokenDescription::from_token(&self.token); let mut diag = DiagnosticBuilder::new( -- cgit 1.4.1-3-g733a5