1
Fork 0

Introduce new-style attribute parsers for several attributes

note: compiler compiles but librustdoc and clippy don't
This commit is contained in:
Jana Dönszelmann 2025-02-09 22:49:33 +01:00
parent dbd3b7928e
commit 7e0f5b5016
No known key found for this signature in database
50 changed files with 1519 additions and 1342 deletions

View file

@ -732,13 +732,6 @@ pub(crate) struct AssociatedSuggestion2 {
pub potential_assoc: Ident,
}
#[derive(Diagnostic)]
#[diag(ast_passes_stability_outside_std, code = E0734)]
pub(crate) struct StabilityOutsideStd {
#[primary_span]
pub span: Span,
}
#[derive(Diagnostic)]
#[diag(ast_passes_feature_on_non_nightly, code = E0554)]
pub(crate) struct FeatureOnNonNightly {

View file

@ -178,18 +178,6 @@ impl<'a> Visitor<'a> for PostExpansionVisitor<'a> {
);
}
}
// Emit errors for non-staged-api crates.
if !self.features.staged_api() {
if attr.has_name(sym::unstable)
|| attr.has_name(sym::stable)
|| attr.has_name(sym::rustc_const_unstable)
|| attr.has_name(sym::rustc_const_stable)
|| attr.has_name(sym::rustc_default_body_unstable)
{
self.sess.dcx().emit_err(errors::StabilityOutsideStd { span: attr.span });
}
}
}
fn visit_item(&mut self, i: &'a ast::Item) {