diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-02-12 22:26:35 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2020-02-12 22:26:35 +0000 |
commit | 5e464d058b5043c663b0fe14bd9291c7b7b44d43 (patch) | |
tree | 6ba56780c62ab3ab6544499831f73e203263bbfb /crates/ra_parser | |
parent | 3da53ab3e75b0486c1b2e4f74babea10992c4747 (diff) | |
parent | bed9c083de54283779a889fed4accc55f84483dc (diff) |
Merge #3127
3127: Support unnamed arguments in function pointers r=edwin0cheng a=hanmertens
Fixes #3089
Co-authored-by: Han Mertens <[email protected]>
Diffstat (limited to 'crates/ra_parser')
-rw-r--r-- | crates/ra_parser/src/grammar/params.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar/params.rs b/crates/ra_parser/src/grammar/params.rs index ed4f93347..272661b1d 100644 --- a/crates/ra_parser/src/grammar/params.rs +++ b/crates/ra_parser/src/grammar/params.rs | |||
@@ -114,8 +114,11 @@ fn value_parameter(p: &mut Parser, flavor: Flavor) { | |||
114 | // test fn_pointer_param_ident_path | 114 | // test fn_pointer_param_ident_path |
115 | // type Foo = fn(Bar::Baz); | 115 | // type Foo = fn(Bar::Baz); |
116 | // type Qux = fn(baz: Bar::Baz); | 116 | // type Qux = fn(baz: Bar::Baz); |
117 | |||
118 | // test fn_pointer_unnamed_arg | ||
119 | // type Foo = fn(_: bar); | ||
117 | Flavor::FnPointer => { | 120 | Flavor::FnPointer => { |
118 | if p.at(IDENT) && p.nth(1) == T![:] && !p.nth_at(1, T![::]) { | 121 | if (p.at(IDENT) || p.at(UNDERSCORE)) && p.nth(1) == T![:] && !p.nth_at(1, T![::]) { |
119 | patterns::pattern_single(p); | 122 | patterns::pattern_single(p); |
120 | types::ascription(p); | 123 | types::ascription(p); |
121 | } else { | 124 | } else { |