remove gate macros from BUILTIN_ATTRIBUTES#155302
remove gate macros from BUILTIN_ATTRIBUTES#155302Bryntet wants to merge 3 commits intorust-lang:mainfrom
Conversation
| let attr_info = attr.name().and_then(|name| BUILTIN_ATTRIBUTE_MAP.get(&name)); | ||
| // Check feature gates for built-in attributes. | ||
| if let Some(BuiltinAttribute { | ||
| gate: AttributeGate::Gated { feature, message, check, notes, .. }, | ||
| .. | ||
| }) = attr_info | ||
| { | ||
| gate_alt!(self, check(self.features), *feature, attr.span, *message, *notes); | ||
| } |
There was a problem hiding this comment.
this logic is moved to rustc_attr_parsing/src/feature_gate.rs which gets called from rustc_attr_parsing/src/interface.rs
|
The job Click to see the possible cause of the failure (guessed by this bot) |
There was a problem hiding this comment.
I don't have time to fully parse everything rn, just a question. If the gate is Gated::Ignore, is the attribute parser still called? i.e. is this code
rust/compiler/rustc_attr_parsing/src/attributes/diagnostic/on_move.rs
Lines 26 to 28 in 57cb10a
| pub fn is_stable_diagnostic_attribute(sym: Symbol, features: &Features) -> bool { | ||
| match sym { | ||
| sym::on_unimplemented | sym::do_not_recommend => true, | ||
| sym::on_const => features.diagnostic_on_const(), | ||
| sym::on_move => features.diagnostic_on_move(), | ||
| _ => false, | ||
| } |
There was a problem hiding this comment.
This was removed in #155209, this looks like you accidentally resurrected it.
| #[derive(Clone, Debug, Copy)] | ||
| pub enum GateKind { | ||
| Error, | ||
| Ignore, |
There was a problem hiding this comment.
Is Ignore only used for diagnostic attr feature gates? (Please add a comment).
draft for removing
gated!,ungated!andrustc_attr!macros fromBUILTIN_ATTRIBUTES