From 506e1ddbfa5213f254923da9bbf0efddc6f1fc34 Mon Sep 17 00:00:00 2001 From: Matthew Jasper Date: Wed, 10 Jun 2020 11:30:48 +0100 Subject: Separating parsing of `for` in predicates and types --- crates/ra_parser/src/grammar/type_params.rs | 22 +++++++++++++++++++++- 1 file changed, 21 insertions(+), 1 deletion(-) (limited to 'crates/ra_parser/src/grammar/type_params.rs') 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) { } _ => { // test where_pred_for - // fn test() + // fn for_trait() // where // for<'a> F: Fn(&'a str) // { } + // fn for_ref() + // where + // for<'a> &'a F: Debug + // { } + // fn for_parens() + // where + // for<'a> (&'a F): Fn(&'a str) + // { } + // fn for_slice() + // where + // for<'a> [&'a F]: Eq + // { } + // fn for_qpath(_t: &T) + // where + // for<'a> <&'a T as Baz>::Foo: Iterator + // { } + if p.at(T![for]) { + types::for_binder(p); + } + types::type_(p); if p.at(T![:]) { -- cgit v1.2.3