-
Notifications
You must be signed in to change notification settings - Fork 13.5k
rework #[naked]
attribute parser
#142493
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?
rework #[naked]
attribute parser
#142493
Conversation
48b6d12
to
78a8771
Compare
This comment has been minimized.
This comment has been minimized.
cc: @folkertdev this might interest you |
This comment has been minimized.
This comment has been minimized.
☔ The latest upstream changes (presumably #142795) made this pull request unmergeable. Please resolve the merge conflicts. |
Some changes occurred in compiler/rustc_codegen_ssa |
let Some(span) = self.span else { | ||
return None; | ||
}; |
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.
let span = self.span?;
// only if we found a naked attribute do we do the somewhat expensive check | ||
'outer: for other_attr in cx.all_attrs { | ||
for allowed_attr in ALLOW_LIST { | ||
if other_attr.word_is(*allowed_attr) || other_attr.starts_with(&[sym::rustfmt]) { |
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.
is clippy using custom tool attrs nowadays? May be good to ignore those, too
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 also move the rustfmt check out of the loop
|
||
/// A list of all attribute on this syntax node. | ||
/// | ||
/// Useful for allowlists in finalize. |
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.
Useful for compatibility checks with other attributes in finalize
r? @oli-obk