mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-09-28 04:44:57 +00:00
Merge #1072
1072: recognize async move blocks r=matklad a=memoryruins closes #1053 Co-authored-by: memoryruins <memoryruinsmusic@gmail.com>
This commit is contained in:
commit
4666138c91
4 changed files with 43 additions and 3 deletions
|
@ -92,10 +92,10 @@ pub(super) fn atom_expr(p: &mut Parser, r: Restrictions) -> Option<(CompletedMar
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
ASYNC_KW if la == L_CURLY => {
|
||||
ASYNC_KW if la == L_CURLY || la == MOVE_KW => {
|
||||
let m = p.start();
|
||||
p.bump();
|
||||
p.eat(MOVE_KW);
|
||||
block_expr(p, Some(m))
|
||||
}
|
||||
MATCH_KW => match_expr(p),
|
||||
|
|
|
@ -82,7 +82,7 @@ pub(super) fn maybe_item(p: &mut Parser, m: Marker, flavor: ItemFlavor) -> Resul
|
|||
// test_err async_without_semicolon
|
||||
// fn foo() { let _ = async {} }
|
||||
has_mods |= p.eat(CONST_KW);
|
||||
if p.at(ASYNC_KW) && p.nth(1) != L_CURLY {
|
||||
if p.at(ASYNC_KW) && p.nth(1) != L_CURLY && p.nth(1) != MOVE_KW {
|
||||
p.eat(ASYNC_KW);
|
||||
has_mods = true;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue