rust-analyzer/ungrammar

Const async functions

dtolnay opened this issue · 0 comments

The ungrammar for Fn suggests async and const are mutually exclusive, but Rust's parser allows functions that are both.

ungrammar/rust.ungram

Lines 126 to 130 in 07d5806

Fn =
Attr* Visibility?
'default'? ('async' | 'const')? 'unsafe'? Abi?
'fn' Name GenericParamList? ParamList RetType? WhereClause?
(body:BlockExpr | ';')

const async fn f();

https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b5513b0a15747aa6f864d4b3f2a415af