about summary refs log tree commit diff
path: root/src/libsyntax/parse/parser
diff options
context:
space:
mode:
authorMazdak Farrokhzad <twingoow@gmail.com>2019-08-17 03:02:56 +0200
committerGitHub <noreply@github.com>2019-08-17 03:02:56 +0200
commitbf04edee2fac9a364c6683921ece8c6c0678e1ec (patch)
treee9081bb86551c7d9606fd7e114adbc26b2ff595d /src/libsyntax/parse/parser
parent7f3c67d4e0c4d8237899c6aa99a174547ff85b09 (diff)
parent20661f18df695058224427fb84d21a0eeec8c657 (diff)
downloadrust-bf04edee2fac9a364c6683921ece8c6c0678e1ec.tar.gz
rust-bf04edee2fac9a364c6683921ece8c6c0678e1ec.zip
Rollup merge of #63545 - Centril:gate-yield-preexp, r=oli-obk
Feature gate 'yield $expr?' pre-expansion

Also improve the overall ergonomics of pre-expansion gating in general.

r? @Zoxc
Diffstat (limited to 'src/libsyntax/parse/parser')
-rw-r--r--src/libsyntax/parse/parser/expr.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs
index f4b6a926734..ccc6bd15067 100644
--- a/src/libsyntax/parse/parser/expr.rs
+++ b/src/libsyntax/parse/parser/expr.rs
@@ -997,6 +997,9 @@ impl<'a> Parser<'a> {
                     } else {
                         ex = ExprKind::Yield(None);
                     }
+
+                    let span = lo.to(hi);
+                    self.sess.yield_spans.borrow_mut().push(span);
                 } else if self.eat_keyword(kw::Let) {
                     return self.parse_let_expr(attrs);
                 } else if is_span_rust_2018 && self.eat_keyword(kw::Await) {