-
Notifications
You must be signed in to change notification settings - Fork 12.8k
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
Fix incorrect gating of nonterminals in key-value attributes #85445
Conversation
r? @davidtwco (rust-highfive has picked a reviewer for you, use r? to override) |
Fixes rust-lang#85432 When processing a `#[derive]` or `#[cfg_eval]` attribute, we need to re-parse our attribute target, which requires flattenting all `Nonterminals`. However, this caused us to incorrectly gate on a (flattented) nonterminal in a key-value attribute, which is supposed to be allowed. Since we already perform this gating during the initial parse, we suppress it in `capture_cfg` mode.
@hellow554 - I added a test locally, but forgot to |
47e4e06
to
fd1e19e
Compare
@Aaron1011 this should already be fixed by #83366, which is waiting on bors. |
@jyn514: Backporting this PR would be much simpler, since it's a one-line diff. |
nevertheless, the test should be included in either PR, probably in this one, because the other one is already approved to bors |
☔ The latest upstream changes (presumably #85458) made this pull request unmergeable. Please resolve the merge conflicts. |
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.
Looks good to me, is my understanding correct that we don't want to r+ this, only backport?
@davidtwco: That's right - now that gating has been removed entirely (since |
@Aaron1011 make you you update this to point to beta, right now the target branch is master |
…ulacrum [beta] backports * Disable the machine outliner by default rust-lang#86020 * Fix incorrect gating of nonterminals in key-value attributes rust-lang#85445 * Build crtbegin.o/crtend.o from source code rust-lang#85395 * Bring back x86_64-sun-solaris target to rustup rust-lang#85252 * Preserve SyntaxContext for invalid/dummy spans in crate metadata rust-lang#85211 * [beta] backport: Remove unsound TrustedRandomAccess implementations rust-lang#86222 r? `@Mark-Simulacrum`
So, should this be closed? |
Yes. |
Fixes #85432
When processing a
#[derive]
or#[cfg_eval]
attribute, we need tore-parse our attribute target, which requires flattenting all
Nonterminals
. However, this caused us to incorrectly gate on a(flattented) nonterminal in a key-value attribute, which is supposed to
be allowed.
Since we already perform this gating during the initial parse, we
suppress it in
capture_cfg
mode.