From f1e62501c3de7932396d29c89588ff296bbcc50d Mon Sep 17 00:00:00 2001 From: Evgenii P Date: Sun, 11 Aug 2019 16:56:05 +0700 Subject: Fix for<'lifetime> for types specified by path --- crates/ra_parser/src/grammar/types.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'crates/ra_parser/src') diff --git a/crates/ra_parser/src/grammar/types.rs b/crates/ra_parser/src/grammar/types.rs index c0b722569..9acc00793 100644 --- a/crates/ra_parser/src/grammar/types.rs +++ b/crates/ra_parser/src/grammar/types.rs @@ -205,6 +205,7 @@ pub(super) fn for_binder(p: &mut Parser) { // type A = for<'a> fn() -> (); // fn foo(_t: &T) where for<'a> &'a T: Iterator {} // fn bar(_t: &T) where for<'a> &'a mut T: Iterator {} +// fn baz(_t: &T) where for<'a> <&'a T as Baz>::Foo: Iterator {} pub(super) fn for_type(p: &mut Parser) { assert!(p.at(T![for])); let m = p.start(); @@ -212,7 +213,7 @@ pub(super) fn for_type(p: &mut Parser) { match p.current() { T![fn] | T![unsafe] | T![extern] => fn_pointer_type(p), T![&] => reference_type(p), - _ if paths::is_path_start(p) => path_type_(p, false), + _ if paths::is_path_start(p) || p.at(T![<]) => path_type_(p, false), _ => p.error("expected a path"), } m.complete(p, FOR_TYPE); -- cgit v1.2.3