diff options
Diffstat (limited to 'crates/libsyntax2/src/grammar/types.rs')
-rw-r--r-- | crates/libsyntax2/src/grammar/types.rs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/grammar/types.rs b/crates/libsyntax2/src/grammar/types.rs index 88631fefe..f58b545c7 100644 --- a/crates/libsyntax2/src/grammar/types.rs +++ b/crates/libsyntax2/src/grammar/types.rs | |||
@@ -12,6 +12,7 @@ pub(super) fn type_(p: &mut Parser) { | |||
12 | FOR_KW => for_type(p), | 12 | FOR_KW => for_type(p), |
13 | IMPL_KW => impl_trait_type(p), | 13 | IMPL_KW => impl_trait_type(p), |
14 | DYN_KW => dyn_trait_type(p), | 14 | DYN_KW => dyn_trait_type(p), |
15 | L_ANGLE => path_type(p), | ||
15 | _ if paths::is_path_start(p) => path_type(p), | 16 | _ if paths::is_path_start(p) => path_type(p), |
16 | _ => { | 17 | _ => { |
17 | p.err_and_bump("expected type"); | 18 | p.err_and_bump("expected type"); |
@@ -214,7 +215,7 @@ fn dyn_trait_type(p: &mut Parser) { | |||
214 | // type C = self::Foo; | 215 | // type C = self::Foo; |
215 | // type D = super::Foo; | 216 | // type D = super::Foo; |
216 | pub(super) fn path_type(p: &mut Parser) { | 217 | pub(super) fn path_type(p: &mut Parser) { |
217 | assert!(paths::is_path_start(p)); | 218 | assert!(paths::is_path_start(p) || p.at(L_ANGLE)); |
218 | let m = p.start(); | 219 | let m = p.start(); |
219 | paths::type_path(p); | 220 | paths::type_path(p); |
220 | // test path_type_with_bounds | 221 | // test path_type_with_bounds |