aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHan Mertens <[email protected]>2020-02-12 21:55:37 +0000
committerHan Mertens <[email protected]>2020-02-12 21:55:37 +0000
commitb435fe8b771c00d5df1f781b21ddae55d64ded42 (patch)
tree9932f2104ce671d0106edbbe5edf31ae14b2c587
parent0e10e77a7820d08332744d91e44940a2321138c3 (diff)
Add test for unnamed argument in function pointer
-rw-r--r--crates/ra_parser/src/grammar/params.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_parser/src/grammar/params.rs b/crates/ra_parser/src/grammar/params.rs
index 4abd61be7..272661b1d 100644
--- a/crates/ra_parser/src/grammar/params.rs
+++ b/crates/ra_parser/src/grammar/params.rs
@@ -114,6 +114,9 @@ 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.at(UNDERSCORE)) && 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);