Gate static coroutines behind a parser feature

This commit is contained in:
Michael Goulet
2025-08-19 13:12:17 +00:00
parent 0330525b1c
commit db0c825d2c
10 changed files with 67 additions and 24 deletions

View File

@@ -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)