about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2021-06-11 22:58:25 +0000
committerbors <bors@rust-lang.org>2021-06-11 22:58:25 +0000
commit0a0f816fcf211fde4e15f8cd3735d873a689b704 (patch)
tree633521e16a47fa2817f26e4d10061bc3412630e7 /compiler/rustc_parse/src
parent05f39bff0fd28f4becad629bf08619297ce03714 (diff)
parent28ea3582642e9b41c7e047e007f68cd7bf20ba45 (diff)
downloadrust-0a0f816fcf211fde4e15f8cd3735d873a689b704.tar.gz
rust-0a0f816fcf211fde4e15f8cd3735d873a689b704.zip
Auto merge of #86225 - Mark-Simulacrum:beta-next, r=Mark-Simulacrum
[beta] backports

* Disable the machine outliner by default #86020
* Fix incorrect gating of nonterminals in key-value attributes #85445
* Build crtbegin.o/crtend.o from source code #85395
* Bring back x86_64-sun-solaris target to rustup #85252
* Preserve SyntaxContext for invalid/dummy spans in crate metadata #85211
* [beta] backport: Remove unsound TrustedRandomAccess implementations #86222

r? `@Mark-Simulacrum`
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/mod.rs7
1 files changed, 5 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/mod.rs b/compiler/rustc_parse/src/parser/mod.rs
index ed95a5661b1..a55eb3cf752 100644
--- a/compiler/rustc_parse/src/parser/mod.rs
+++ b/compiler/rustc_parse/src/parser/mod.rs
@@ -1077,8 +1077,11 @@ impl<'a> Parser<'a> {
                     let span = expr.span;
 
                     match &expr.kind {
-                        // Not gated to supporte things like `doc = $expr` that work on stable.
-                        _ if is_interpolated_expr => {}
+                        // Not gated to support things like `doc = $expr` that work on stable.
+                        // Do not gate in `capture_cfg` mode, since we flatten all nontemrinals
+                        // before parsing. `capture_cfg` mode is only used to reparse existing
+                        // tokens, so the gating will be performed by the initial parse
+                        _ if is_interpolated_expr || self.capture_cfg => {}
                         ExprKind::Lit(lit) if lit.kind.is_unsuffixed() => {}
                         _ => self.sess.gated_spans.gate(sym::extended_key_value_attributes, span),
                     }