-
Notifications
You must be signed in to change notification settings - Fork 533
Update naked
to use the attribute template
#1908
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
To follow the attribute template, and to simplify the wording a little.
Naked attributes cannot have the "Rust" ABI. https://github.com/rust-lang/rust/blob/aae43c4532690153af7465227816c93036bb1604/compiler/rustc_passes/src/check_attr.rs#L641-L652
- [Free functions][items.fn] | ||
- [Inherent associated functions][items.associated.fn] | ||
- [Trait impl functions][items.impl.trait] | ||
- [Trait definition functions][items.traits] with a body |
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.
does this work
- [Trait definition functions][items.traits] with a body | |
- [Trait][items.traits] [associated functions][items.associated.fn] with a body |
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.
This wording can be ambiguous, since it is unclear if it is an associated function in a trait definition or a trait impl. The original wording was specifically chosen to avoid that ambiguity and contrast with the previous item.
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.
initially wanted to link this to items.traits.associated-item-decls
, due to being more specific, because items.traits
was too general
- [Trait definition functions][items.traits.associated-item-decls] with a body
is that alright
just 1 comment, otherwise this is good |
New rules:
attributes.codegen.naked.syntax
attributes.codegen.naked.allowed-positions
attributes.codegen.naked.duplicates
attributes.codegen.naked.target_feature
attributes.codegen.naked.abi
Renamed rules:
attributes.codegen.naked.unsafe-attribute
is nowattributes.codegen.naked.unsafe