diff options
Diffstat (limited to 'crates/ra_parser/src/grammar')
-rw-r--r-- | crates/ra_parser/src/grammar/types.rs | 3 |
1 files changed, 2 insertions, 1 deletions
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) { | |||
205 | // type A = for<'a> fn() -> (); | 205 | // type A = for<'a> fn() -> (); |
206 | // fn foo<T>(_t: &T) where for<'a> &'a T: Iterator {} | 206 | // fn foo<T>(_t: &T) where for<'a> &'a T: Iterator {} |
207 | // fn bar<T>(_t: &T) where for<'a> &'a mut T: Iterator {} | 207 | // fn bar<T>(_t: &T) where for<'a> &'a mut T: Iterator {} |
208 | // fn baz<T>(_t: &T) where for<'a> <&'a T as Baz>::Foo: Iterator {} | ||
208 | pub(super) fn for_type(p: &mut Parser) { | 209 | pub(super) fn for_type(p: &mut Parser) { |
209 | assert!(p.at(T![for])); | 210 | assert!(p.at(T![for])); |
210 | let m = p.start(); | 211 | let m = p.start(); |
@@ -212,7 +213,7 @@ pub(super) fn for_type(p: &mut Parser) { | |||
212 | match p.current() { | 213 | match p.current() { |
213 | T![fn] | T![unsafe] | T![extern] => fn_pointer_type(p), | 214 | T![fn] | T![unsafe] | T![extern] => fn_pointer_type(p), |
214 | T![&] => reference_type(p), | 215 | T![&] => reference_type(p), |
215 | _ if paths::is_path_start(p) => path_type_(p, false), | 216 | _ if paths::is_path_start(p) || p.at(T![<]) => path_type_(p, false), |
216 | _ => p.error("expected a path"), | 217 | _ => p.error("expected a path"), |
217 | } | 218 | } |
218 | m.complete(p, FOR_TYPE); | 219 | m.complete(p, FOR_TYPE); |