diff options
Diffstat (limited to 'crates/ra_syntax/src/grammar/types.rs')
-rw-r--r-- | crates/ra_syntax/src/grammar/types.rs | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/crates/ra_syntax/src/grammar/types.rs b/crates/ra_syntax/src/grammar/types.rs index f308aef89..ed2718e73 100644 --- a/crates/ra_syntax/src/grammar/types.rs +++ b/crates/ra_syntax/src/grammar/types.rs | |||
@@ -188,13 +188,22 @@ fn fn_pointer_type(p: &mut Parser) { | |||
188 | m.complete(p, FN_POINTER_TYPE); | 188 | m.complete(p, FN_POINTER_TYPE); |
189 | } | 189 | } |
190 | 190 | ||
191 | pub(super) fn for_binder(p: &mut Parser) { | ||
192 | assert!(p.at(FOR_KW)); | ||
193 | p.bump(); | ||
194 | if p.at(L_ANGLE) { | ||
195 | type_params::opt_type_param_list(p); | ||
196 | } else { | ||
197 | p.error("expected `<`"); | ||
198 | } | ||
199 | } | ||
200 | |||
191 | // test for_type | 201 | // test for_type |
192 | // type A = for<'a> fn() -> (); | 202 | // type A = for<'a> fn() -> (); |
193 | pub(super) fn for_type(p: &mut Parser) { | 203 | pub(super) fn for_type(p: &mut Parser) { |
194 | assert!(p.at(FOR_KW)); | 204 | assert!(p.at(FOR_KW)); |
195 | let m = p.start(); | 205 | let m = p.start(); |
196 | p.bump(); | 206 | for_binder(p); |
197 | type_params::opt_type_param_list(p); | ||
198 | match p.current() { | 207 | match p.current() { |
199 | FN_KW | UNSAFE_KW | EXTERN_KW => fn_pointer_type(p), | 208 | FN_KW | UNSAFE_KW | EXTERN_KW => fn_pointer_type(p), |
200 | _ if paths::is_path_start(p) => path_type_(p, false), | 209 | _ if paths::is_path_start(p) => path_type_(p, false), |