-
Notifications
You must be signed in to change notification settings - Fork 13.5k
Rewrite empty attribute lint for new attribute parser #143252
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?
Rewrite empty attribute lint for new attribute parser #143252
Conversation
Signed-off-by: Jonathan Brouwer <jonathantbrouwer@gmail.com>
☔ The latest upstream changes (presumably #143338) made this pull request unmergeable. Please resolve the merge conflicts. |
@@ -285,7 +283,7 @@ pub enum AttributeKind { | |||
PubTransparent(Span), | |||
|
|||
/// Represents [`#[repr]`](https://doc.rust-lang.org/stable/reference/type-layout.html#representations). | |||
Repr(ThinVec<(ReprAttr, Span)>), | |||
Repr(ThinVec<(ReprAttr, Span)>, Span), |
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.
could you call this field "first_span"?
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.
do you need this field at all if the warning always happens in thiscrate (attr_parsing)
@@ -12,4 +12,5 @@ pub struct AttributeLint<Id> { | |||
pub enum AttributeLintKind { | |||
UnusedDuplicate { this: Span, other: Span, warning: bool }, | |||
IllFormedAttributeInput { suggestions: Vec<String> }, | |||
EmptyAttribute { span: Span }, |
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.
same
Target::Struct | Target::Union | Target::Enum => {} | ||
Target::Fn | Target::Method(_) => { | ||
self.dcx().emit_err(errors::ReprAlignShouldBeAlign { | ||
span: first_attr_span, |
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.
right, with repr you need it here
cc @jdonszelmann
This is blocked on some of the changes from #142876