From 497100a13c72d290a167ae6eb5566fca653ba99f Mon Sep 17 00:00:00 2001 From: CastilloDel Date: Fri, 11 Oct 2024 22:05:58 +0200 Subject: Emit an error for unstable attributes that reference already stable features Add missing error annotations and .stderr file Acknowledge comments --- compiler/rustc_passes/src/errors.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) (limited to 'compiler/rustc_passes/src/errors.rs') diff --git a/compiler/rustc_passes/src/errors.rs b/compiler/rustc_passes/src/errors.rs index 29a087bf759..021145aff7c 100644 --- a/compiler/rustc_passes/src/errors.rs +++ b/compiler/rustc_passes/src/errors.rs @@ -1496,6 +1496,17 @@ pub(crate) struct CannotStabilizeDeprecated { pub item_sp: Span, } +#[derive(Diagnostic)] +#[diag(passes_unstable_attr_for_already_stable_feature)] +pub(crate) struct UnstableAttrForAlreadyStableFeature { + #[primary_span] + #[label] + #[help] + pub span: Span, + #[label(passes_item)] + pub item_sp: Span, +} + #[derive(Diagnostic)] #[diag(passes_missing_stability_attr)] pub(crate) struct MissingStabilityAttr<'a> { -- cgit 1.4.1-3-g733a5