From f08c43afc7b801f2ab0109764df9cc959ebc8b79 Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Sun, 14 Jul 2024 14:22:11 -0400 Subject: [PATCH] Suppress some fallout from gen in synstructure --- compiler/rustc_macros/src/diagnostics/diagnostic.rs | 4 ++++ compiler/rustc_macros/src/diagnostics/subdiagnostic.rs | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/compiler/rustc_macros/src/diagnostics/diagnostic.rs b/compiler/rustc_macros/src/diagnostics/diagnostic.rs index a3abbdcf18c..2743660ab89 100644 --- a/compiler/rustc_macros/src/diagnostics/diagnostic.rs +++ b/compiler/rustc_macros/src/diagnostics/diagnostic.rs @@ -71,6 +71,8 @@ impl<'a> DiagnosticDerive<'a> { }); // A lifetime of `'a` causes conflicts, but `_sess` is fine. + // FIXME(edition_2024): Fix the `keyword_idents_2024` lint to not trigger here? + #[allow(keyword_idents_2024)] let mut imp = structure.gen_impl(quote! { gen impl<'_sess, G> rustc_errors::Diagnostic<'_sess, G> for @Self where G: rustc_errors::EmissionGuarantee @@ -148,6 +150,8 @@ impl<'a> LintDiagnosticDerive<'a> { } }); + // FIXME(edition_2024): Fix the `keyword_idents_2024` lint to not trigger here? + #[allow(keyword_idents_2024)] let mut imp = structure.gen_impl(quote! { gen impl<'__a> rustc_errors::LintDiagnostic<'__a, ()> for @Self { #[track_caller] diff --git a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs index 69014f39925..7f090f5ebc1 100644 --- a/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs +++ b/compiler/rustc_macros/src/diagnostics/subdiagnostic.rs @@ -86,6 +86,9 @@ impl SubdiagnosticDerive { let diag = &self.diag; let f = &self.f; + + // FIXME(edition_2024): Fix the `keyword_idents_2024` lint to not trigger here? + #[allow(keyword_idents_2024)] let ret = structure.gen_impl(quote! { gen impl rustc_errors::Subdiagnostic for @Self { fn add_to_diag_with<__G, __F>( @@ -100,6 +103,7 @@ impl SubdiagnosticDerive { } } }); + ret } }