X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=crates%2Fparser%2Fsrc%2Fgrammar%2Fexpressions%2Fatom.rs;h=4b7a1b31fbdfc6ee78df6ee330ef73515f0453bd;hb=9c6542f2097df1cfcc9491036ec607c6a2842070;hp=53dbbfea7549372138cda855dd71ed1ef2c45e20;hpb=dc68b894692d309e71d9b639ac6325a9d1cb67e0;p=rust.git diff --git a/crates/parser/src/grammar/expressions/atom.rs b/crates/parser/src/grammar/expressions/atom.rs index 53dbbfea754..4b7a1b31fbd 100644 --- a/crates/parser/src/grammar/expressions/atom.rs +++ b/crates/parser/src/grammar/expressions/atom.rs @@ -72,14 +72,10 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar T!['('] => tuple_expr(p), T!['['] => array_expr(p), 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![|] - || (la == T![move] && p.nth(2) == T![|]) - || (la == T![async] && p.nth(2) == T![|]) - || (la == T![async] && p.nth(2) == T![move] && p.nth(3) == T![|]) => - { + T![static] | T![async] | T![move] if la == T![|] => closure_expr(p), + T![static] | T![async] if la == T![move] && p.nth(2) == T![|] => closure_expr(p), + T![static] if la == T![async] && p.nth(2) == T![|] => closure_expr(p), + T![static] if la == T![async] && p.nth(2) == T![move] && p.nth(3) == T![|] => { closure_expr(p) } T![if] => if_expr(p),