Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/parser/src/grammar/expressions/atom.rs')
-rw-r--r--crates/parser/src/grammar/expressions/atom.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs
index 7f9b9768da..76d9b39d38 100644
--- a/crates/parser/src/grammar/expressions/atom.rs
+++ b/crates/parser/src/grammar/expressions/atom.rs
@@ -74,7 +74,7 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
T![|] => closure_expr(p),
T![move] if la == T![|] => closure_expr(p),
T![async] if la == T![|] || (la == T![move] && p.nth(2) == T![|]) => closure_expr(p),
- T![static] if la == T![|] => closure_expr(p),
+ T![static] if la == T![|] || (la == T![move] && p.nth(2) == T![|]) => closure_expr(p),
T![if] => if_expr(p),
T![loop] => loop_expr(p, None),
@@ -236,6 +236,7 @@ fn array_expr(p: &mut Parser) -> CompletedMarker {
// move || {};
// async move || {};
// static || {};
+// static move || {};
// }
fn closure_expr(p: &mut Parser) -> CompletedMarker {
assert!(
@@ -244,11 +245,12 @@ fn closure_expr(p: &mut Parser) -> CompletedMarker {
|| (p.at(T![async]) && p.nth(1) == T![|])
|| (p.at(T![async]) && p.nth(1) == T![move] && p.nth(2) == T![|])
|| (p.at(T![static]) && p.nth(1) == T![|])
+ || (p.at(T![static]) && p.nth(1) == T![move] && p.nth(2) == T![|])
);
let m = p.start();
p.eat(T![async]);
- p.eat(T![move]);
p.eat(T![static]);
+ p.eat(T![move]);
params::param_list_closure(p);
if opt_ret_type(p) {
// test lambda_ret_block