-
Notifications
You must be signed in to change notification settings - Fork 13.7k
mbe: Implement unsafe
attribute rules
#146535
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?
Conversation
This simplifies subsequent initialization of enum variants.
Some changes occurred in compiler/rustc_attr_parsing |
r? @davidtwco rustbot has assigned @davidtwco. Use |
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.
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.
While I was preparing a talk for the Rust 4linux summit, I did a first pass on this, and it looks good!
Will do a final pass on it next week
Thanks for bringing this forward
This implements
unsafe attr
rules for declarativemacro_rules!
attributes, as specified in RFC 3697.An invocation of an attribute that uses an
unsafe attr
rule requires theunsafe(attr(...))
syntax.An invocation of an attribute that uses an ordinary
attr
rule must not use theunsafe(attr(...))
syntax.unsafe
is only supported on anattr
rule, not any other kind ofmacro_rules!
rule.Tracking issue for
macro_rules!
attributes: #143547