From 0e10e77a7820d08332744d91e44940a2321138c3 Mon Sep 17 00:00:00 2001 From: Han Mertens Date: Wed, 12 Feb 2020 21:40:05 +0100 Subject: Support unnamed arguments in function pointers Fixes #3089 --- crates/ra_parser/src/grammar/params.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'crates/ra_parser') diff --git a/crates/ra_parser/src/grammar/params.rs b/crates/ra_parser/src/grammar/params.rs index ed4f93347..4abd61be7 100644 --- a/crates/ra_parser/src/grammar/params.rs +++ b/crates/ra_parser/src/grammar/params.rs @@ -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 { -- cgit v1.2.3