diff options
Diffstat (limited to 'crates/libsyntax2/src/grammar/types.rs')
-rw-r--r-- | crates/libsyntax2/src/grammar/types.rs | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/crates/libsyntax2/src/grammar/types.rs b/crates/libsyntax2/src/grammar/types.rs index 89030e66c..a52355b50 100644 --- a/crates/libsyntax2/src/grammar/types.rs +++ b/crates/libsyntax2/src/grammar/types.rs | |||
@@ -8,6 +8,9 @@ pub(super) const TYPE_FIRST: TokenSet = | |||
8 | paths::PATH_FIRST, | 8 | paths::PATH_FIRST, |
9 | ]; | 9 | ]; |
10 | 10 | ||
11 | const TYPE_RECOVERY_SET: TokenSet = | ||
12 | token_set![R_PAREN, COMMA]; | ||
13 | |||
11 | pub(super) fn type_(p: &mut Parser) { | 14 | pub(super) fn type_(p: &mut Parser) { |
12 | match p.current() { | 15 | match p.current() { |
13 | L_PAREN => paren_or_tuple_type(p), | 16 | L_PAREN => paren_or_tuple_type(p), |
@@ -23,7 +26,7 @@ pub(super) fn type_(p: &mut Parser) { | |||
23 | L_ANGLE => path_type(p), | 26 | L_ANGLE => path_type(p), |
24 | _ if paths::is_path_start(p) => path_type(p), | 27 | _ if paths::is_path_start(p) => path_type(p), |
25 | _ => { | 28 | _ => { |
26 | p.err_and_bump("expected type"); | 29 | p.err_recover("expected type", TYPE_RECOVERY_SET); |
27 | } | 30 | } |
28 | } | 31 | } |
29 | } | 32 | } |