diff options
author | Matthew Jasper <[email protected]> | 2020-06-10 11:30:48 +0100 |
---|---|---|
committer | Matthew Jasper <[email protected]> | 2020-06-10 11:30:58 +0100 |
commit | 506e1ddbfa5213f254923da9bbf0efddc6f1fc34 (patch) | |
tree | 2c220370c38a8a79a6d9b07d0fe184db0d827e1d /crates/ra_parser/src/grammar/type_params.rs | |
parent | 560b98bc505be6ff70876df661e4055e1b38a78c (diff) |
Separating parsing of `for` in predicates and types
Diffstat (limited to 'crates/ra_parser/src/grammar/type_params.rs')
-rw-r--r-- | crates/ra_parser/src/grammar/type_params.rs | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/crates/ra_parser/src/grammar/type_params.rs b/crates/ra_parser/src/grammar/type_params.rs index 50e4900c3..b3508c732 100644 --- a/crates/ra_parser/src/grammar/type_params.rs +++ b/crates/ra_parser/src/grammar/type_params.rs | |||
@@ -191,10 +191,30 @@ fn where_predicate(p: &mut Parser) { | |||
191 | } | 191 | } |
192 | _ => { | 192 | _ => { |
193 | // test where_pred_for | 193 | // test where_pred_for |
194 | // fn test<F>() | 194 | // fn for_trait<F>() |
195 | // where | 195 | // where |
196 | // for<'a> F: Fn(&'a str) | 196 | // for<'a> F: Fn(&'a str) |
197 | // { } | 197 | // { } |
198 | // fn for_ref<F>() | ||
199 | // where | ||
200 | // for<'a> &'a F: Debug | ||
201 | // { } | ||
202 | // fn for_parens<F>() | ||
203 | // where | ||
204 | // for<'a> (&'a F): Fn(&'a str) | ||
205 | // { } | ||
206 | // fn for_slice<F>() | ||
207 | // where | ||
208 | // for<'a> [&'a F]: Eq | ||
209 | // { } | ||
210 | // fn for_qpath<T>(_t: &T) | ||
211 | // where | ||
212 | // for<'a> <&'a T as Baz>::Foo: Iterator | ||
213 | // { } | ||
214 | if p.at(T![for]) { | ||
215 | types::for_binder(p); | ||
216 | } | ||
217 | |||
198 | types::type_(p); | 218 | types::type_(p); |
199 | 219 | ||
200 | if p.at(T![:]) { | 220 | if p.at(T![:]) { |