diff options
Diffstat (limited to 'crates/parser/src/grammar/type_params.rs')
-rw-r--r-- | crates/parser/src/grammar/type_params.rs | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/crates/parser/src/grammar/type_params.rs b/crates/parser/src/grammar/type_params.rs index 90dabb4c0..bc7d8d724 100644 --- a/crates/parser/src/grammar/type_params.rs +++ b/crates/parser/src/grammar/type_params.rs | |||
@@ -2,14 +2,14 @@ | |||
2 | 2 | ||
3 | use super::*; | 3 | use super::*; |
4 | 4 | ||
5 | pub(super) fn opt_type_param_list(p: &mut Parser) { | 5 | pub(super) fn opt_generic_param_list(p: &mut Parser) { |
6 | if !p.at(T![<]) { | 6 | if !p.at(T![<]) { |
7 | return; | 7 | return; |
8 | } | 8 | } |
9 | type_param_list(p); | 9 | generic_param_list(p); |
10 | } | 10 | } |
11 | 11 | ||
12 | fn type_param_list(p: &mut Parser) { | 12 | fn generic_param_list(p: &mut Parser) { |
13 | assert!(p.at(T![<])); | 13 | assert!(p.at(T![<])); |
14 | let m = p.start(); | 14 | let m = p.start(); |
15 | p.bump(T![<]); | 15 | p.bump(T![<]); |
@@ -20,12 +20,12 @@ fn type_param_list(p: &mut Parser) { | |||
20 | // test generic_lifetime_type_attribute | 20 | // test generic_lifetime_type_attribute |
21 | // fn foo<#[derive(Lifetime)] 'a, #[derive(Type)] T>(_: &'a T) { | 21 | // fn foo<#[derive(Lifetime)] 'a, #[derive(Type)] T>(_: &'a T) { |
22 | // } | 22 | // } |
23 | attributes::outer_attributes(p); | 23 | attributes::outer_attrs(p); |
24 | 24 | ||
25 | match p.current() { | 25 | match p.current() { |
26 | LIFETIME => lifetime_param(p, m), | 26 | LIFETIME => lifetime_param(p, m), |
27 | IDENT => type_param(p, m), | 27 | IDENT => type_param(p, m), |
28 | CONST_KW => type_const_param(p, m), | 28 | CONST_KW => const_param(p, m), |
29 | _ => { | 29 | _ => { |
30 | m.abandon(p); | 30 | m.abandon(p); |
31 | p.err_and_bump("expected type parameter") | 31 | p.err_and_bump("expected type parameter") |
@@ -65,7 +65,7 @@ fn type_param(p: &mut Parser, m: Marker) { | |||
65 | 65 | ||
66 | // test const_param | 66 | // test const_param |
67 | // struct S<const N: u32>; | 67 | // struct S<const N: u32>; |
68 | fn type_const_param(p: &mut Parser, m: Marker) { | 68 | fn const_param(p: &mut Parser, m: Marker) { |
69 | assert!(p.at(CONST_KW)); | 69 | assert!(p.at(CONST_KW)); |
70 | p.bump(T![const]); | 70 | p.bump(T![const]); |
71 | name(p); | 71 | name(p); |