-
Notifications
You must be signed in to change notification settings - Fork 13.3k
Force exhaustive handling of parsed attributes #140372
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -57,14 +57,6 @@ impl OptimizeAttr { | |||||
} | ||||||
} | ||||||
|
||||||
#[derive(Clone, Debug, Encodable, Decodable, HashStable_Generic, PrintAttribute)] | ||||||
pub enum DiagnosticAttribute { | ||||||
// tidy-alphabetical-start | ||||||
DoNotRecommend, | ||||||
OnUnimplemented, | ||||||
// tidy-alphabetical-end | ||||||
} | ||||||
|
||||||
#[derive(PartialEq, Debug, Encodable, Decodable, Copy, Clone, HashStable_Generic, PrintAttribute)] | ||||||
pub enum ReprAttr { | ||||||
ReprInt(IntType), | ||||||
|
@@ -160,37 +152,49 @@ impl Deprecation { | |||||
#[derive(Clone, Debug, HashStable_Generic, Encodable, Decodable, PrintAttribute)] | ||||||
pub enum AttributeKind { | ||||||
// tidy-alphabetical-start | ||||||
/// Represents [`#[rustc_allow_const_fn_unstable]`](<https://github.com/rust-lang/rust/issues/69399>). | ||||||
AllowConstFnUnstable(ThinVec<Symbol>), | ||||||
|
||||||
/// Represents `#[allow_internal_unstable]`. | ||||||
AllowInternalUnstable(ThinVec<(Symbol, Span)>), | ||||||
|
||||||
/// Represents `#[rustc_default_body_unstable]`. | ||||||
BodyStability { | ||||||
stability: DefaultBodyStability, | ||||||
/// Span of the `#[rustc_default_body_unstable(...)]` attribute | ||||||
span: Span, | ||||||
}, | ||||||
|
||||||
/// Represents `#[rustc_confusables]`. | ||||||
Confusables { | ||||||
symbols: ThinVec<Symbol>, | ||||||
// FIXME(jdonszelmann): remove when target validation code is moved | ||||||
first_span: Span, | ||||||
}, | ||||||
|
||||||
/// Represents `#[rustc_const_stable]` and `#[rustc_const_unstable]`. | ||||||
ConstStability { | ||||||
stability: PartialConstStability, | ||||||
/// Span of the `#[rustc_const_stable(...)]` or `#[rustc_const_unstable(...)]` attribute | ||||||
span: Span, | ||||||
}, | ||||||
|
||||||
/// Represents `#[rustc_const_stable_indirect]`. | ||||||
ConstStabilityIndirect, | ||||||
Deprecation { | ||||||
deprecation: Deprecation, | ||||||
span: Span, | ||||||
}, | ||||||
Diagnostic(DiagnosticAttribute), | ||||||
DocComment { | ||||||
style: AttrStyle, | ||||||
kind: CommentKind, | ||||||
span: Span, | ||||||
comment: Symbol, | ||||||
}, | ||||||
|
||||||
/// Represents [`#[deprecated]`](<https://doc.rust-lang.org/stable/reference/attributes/diagnostics.html#the-deprecated-attribute>). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: ditto |
||||||
Deprecation { deprecation: Deprecation, span: Span }, | ||||||
|
||||||
/// Represents []`#[doc]`](<https://doc.rust-lang.org/stable/rustdoc/write-documentation/the-doc-attribute.html>). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: broken link
Suggested change
|
||||||
DocComment { style: AttrStyle, kind: CommentKind, span: Span, comment: Symbol }, | ||||||
|
||||||
/// Represents `#[rustc_macro_transparency]`. | ||||||
MacroTransparency(Transparency), | ||||||
|
||||||
/// Represents []`#[repr]`](<https://doc.rust-lang.org/stable/reference/type-layout.html#representations>). | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Nit: broken too |
||||||
Repr(ThinVec<(ReprAttr, Span)>), | ||||||
|
||||||
/// Represents `#[stable]` and `#[unstable]`. | ||||||
Stability { | ||||||
stability: Stability, | ||||||
/// Span of the `#[stable(...)]` or `#[unstable(...)]` attribute | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nit: I think these need to be (no
<>
)