Repository navigation
Conversation
It's an error to have `#[inline]#[rustc_force_inline]fn blah(){}`, but they both lower to the same `InlineAttr`, so this would error and then have an attribute list of multiple inline attrs
|
Some changes occurred in compiler/rustc_attr_parsing |
|
r? @jackh726 rustbot has assigned @jackh726. Use Why was this reviewer chosen?The reviewer was selected based on:
|
|
r? me |
|
☔ The latest upstream changes (presumably #164894) made this pull request unmergeable. Please resolve the merge conflicts by rebasing. |
There was a problem hiding this comment.
which breaks the invariant that a list of attributes has no duplicate variants
I'm leaning towards that that's fine, since one of the attributes is rustc internal and the broken invariant is not really observable. Imo this change makes the code less readable. What is the concrete advantage of this change?
Another approach would be replacing rustc_inline_force with #[inline(rustc_force)] or similar, then we can have only one attribute.
|
I wanted to add a (debug) assertion to check for no duplicates (except doc comments) in #164260, but hit it for a rustc_force_inline test instead.
The downside of having |
Another way would be to also add a similar exception for
Yeah I proposed |
It's an error to have
#[inline]#[rustc_force_inline]fn blah(){}, but they both lower to the sameInlineAttr, so this would error and then have an attribute list of multiple inline attrs, which breaks the invariant that a list of attributes has no duplicate variants