diff options
author | Ville Penttinen <[email protected]> | 2019-03-24 18:51:55 +0000 |
---|---|---|
committer | Ville Penttinen <[email protected]> | 2019-03-24 18:51:55 +0000 |
commit | 95505e80fc0f8470fb8eb01b6d46a44d9a3e10dc (patch) | |
tree | 62248d1b075f477f12f67b0044f12223ac0326bc /crates/ra_parser/src | |
parent | 18a8f48039fbfcbbf58e1dadcc95465fe9503691 (diff) |
Support references in higher-ranked trait bounds
Fixes #1020
Diffstat (limited to 'crates/ra_parser/src')
-rw-r--r-- | crates/ra_parser/src/grammar/types.rs | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/crates/ra_parser/src/grammar/types.rs b/crates/ra_parser/src/grammar/types.rs index adc189a29..fdd4f2c52 100644 --- a/crates/ra_parser/src/grammar/types.rs +++ b/crates/ra_parser/src/grammar/types.rs | |||
@@ -202,12 +202,15 @@ pub(super) fn for_binder(p: &mut Parser) { | |||
202 | 202 | ||
203 | // test for_type | 203 | // test for_type |
204 | // type A = for<'a> fn() -> (); | 204 | // type A = for<'a> fn() -> (); |
205 | // fn foo<T>(_t: &T) where for<'a> &'a T: Iterator {} | ||
206 | // fn bar<T>(_t: &T) where for<'a> &'a mut T: Iterator {} | ||
205 | pub(super) fn for_type(p: &mut Parser) { | 207 | pub(super) fn for_type(p: &mut Parser) { |
206 | assert!(p.at(FOR_KW)); | 208 | assert!(p.at(FOR_KW)); |
207 | let m = p.start(); | 209 | let m = p.start(); |
208 | for_binder(p); | 210 | for_binder(p); |
209 | match p.current() { | 211 | match p.current() { |
210 | FN_KW | UNSAFE_KW | EXTERN_KW => fn_pointer_type(p), | 212 | FN_KW | UNSAFE_KW | EXTERN_KW => fn_pointer_type(p), |
213 | AMP => reference_type(p), | ||
211 | _ if paths::is_path_start(p) => path_type_(p, false), | 214 | _ if paths::is_path_start(p) => path_type_(p, false), |
212 | _ => p.error("expected a path"), | 215 | _ => p.error("expected a path"), |
213 | } | 216 | } |