Commit fd1e19e
committed
Fix incorrect gating of nonterminals in key-value attributes
Fixes #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.1 parent a5560a6 commit fd1e19e
File tree
2 files changed
+34
-1
lines changed- compiler/rustc_parse/src/parser
- src/test/ui/macros
2 files changed
+34
-1
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1078 | 1078 | | |
1079 | 1079 | | |
1080 | 1080 | | |
1081 | | - | |
| 1081 | + | |
| 1082 | + | |
| 1083 | + | |
| 1084 | + | |
1082 | 1085 | | |
1083 | 1086 | | |
1084 | 1087 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments