about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorEric Holk <ericholk@microsoft.com>2023-11-29 14:13:35 -0800
committerEric Holk <ericholk@microsoft.com>2023-12-04 11:23:06 -0800
commit7c43784cb07a2e9006acc6f230df27dd28d88dab (patch)
treecd20bc19255a6ffb4efd3c1dec745ae345a41b6f /compiler/rustc_parse/src
parentc104f3b629cfcac35802a899478756abf24ee7c1 (diff)
downloadrust-7c43784cb07a2e9006acc6f230df27dd28d88dab.tar.gz
rust-7c43784cb07a2e9006acc6f230df27dd28d88dab.zip
gate gen fn behind gen_blocks
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/item.rs4
1 files changed, 4 insertions, 0 deletions
diff --git a/compiler/rustc_parse/src/parser/item.rs b/compiler/rustc_parse/src/parser/item.rs
index 4f01ab02c04..766ec50e75b 100644
--- a/compiler/rustc_parse/src/parser/item.rs
+++ b/compiler/rustc_parse/src/parser/item.rs
@@ -2410,6 +2410,10 @@ impl<'a> Parser<'a> {
             }
         }
 
+        if let Gen::Yes { span, .. } = genness {
+            self.sess.gated_spans.gate(sym::gen_blocks, span);
+        }
+
         if !self.eat_keyword_case(kw::Fn, case) {
             // It is possible for `expect_one_of` to recover given the contents of
             // `self.expected_tokens`, therefore, do not use `self.unexpected()` which doesn't