Support unnamed arguments in function pointers

Fixes #3089
This commit is contained in:
Han Mertens 2020-02-12 21:40:05 +01:00
parent 3da53ab3e7
commit 0e10e77a78

View file

@ -115,7 +115,7 @@ fn value_parameter(p: &mut Parser, flavor: Flavor) {
// type Foo = fn(Bar::Baz);
// type Qux = fn(baz: Bar::Baz);
Flavor::FnPointer => {
if p.at(IDENT) && p.nth(1) == T![:] && !p.nth_at(1, T![::]) {
if (p.at(IDENT) || p.at(UNDERSCORE)) && p.nth(1) == T![:] && !p.nth_at(1, T![::]) {
patterns::pattern_single(p);
types::ascription(p);
} else {