aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/types.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/grammar/types.rs')
-rw-r--r--crates/ra_parser/src/grammar/types.rs3
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 {}
205pub(super) fn for_type(p: &mut Parser) { 207pub(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 }