Parse and allow const use closures
This commit is contained in:
parent
4e6407ab94
commit
65d65e5e7e
2 changed files with 14 additions and 3 deletions
|
@ -813,9 +813,9 @@ impl<'a> Parser<'a> {
|
|||
self.is_keyword_ahead(0, &[kw::Const])
|
||||
&& self.look_ahead(1, |t| match &t.kind {
|
||||
// async closures do not work with const closures, so we do not parse that here.
|
||||
token::Ident(kw::Move | kw::Static, IdentIsRaw::No) | token::OrOr | token::Or => {
|
||||
true
|
||||
}
|
||||
token::Ident(kw::Move | kw::Use | kw::Static, IdentIsRaw::No)
|
||||
| token::OrOr
|
||||
| token::Or => true,
|
||||
_ => false,
|
||||
})
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue