about summary refs log tree commit diff
path: root/compiler/rustc_parse
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-08-19 13:12:17 +0000
committerMichael Goulet <michael@errs.io>2025-08-19 13:12:31 +0000
commitdb0c825d2c745fdf87edd501ebda222052f98771 (patch)
tree600ab25153aede40c4a5b980c0da9df2fb1deb44 /compiler/rustc_parse
parent0330525b1ce08ab92383fb266ac52f1c268e89d7 (diff)
downloadrust-db0c825d2c745fdf87edd501ebda222052f98771.tar.gz
rust-db0c825d2c745fdf87edd501ebda222052f98771.zip
Gate static coroutines behind a parser feature
Diffstat (limited to 'compiler/rustc_parse')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 3cedc86dc0d..4d84d48c94b 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -2401,8 +2401,12 @@ impl<'a> Parser<'a> {
 
         let constness = self.parse_closure_constness();
 
-        let movability =
-            if self.eat_keyword(exp!(Static)) { Movability::Static } else { Movability::Movable };
+        let movability = if self.eat_keyword(exp!(Static)) {
+            self.psess.gated_spans.gate(sym::coroutines, self.prev_token.span);
+            Movability::Static
+        } else {
+            Movability::Movable
+        };
 
         let coroutine_kind = if self.token_uninterpolated_span().at_least_rust_2018() {
             self.parse_coroutine_kind(Case::Sensitive)