aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_parser/src/grammar/type_params.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/ra_parser/src/grammar/type_params.rs')
-rw-r--r--crates/ra_parser/src/grammar/type_params.rs18
1 files changed, 9 insertions, 9 deletions
diff --git a/crates/ra_parser/src/grammar/type_params.rs b/crates/ra_parser/src/grammar/type_params.rs
index 31d709d81..7071c70ea 100644
--- a/crates/ra_parser/src/grammar/type_params.rs
+++ b/crates/ra_parser/src/grammar/type_params.rs
@@ -10,7 +10,7 @@ pub(super) fn opt_type_param_list(p: &mut Parser) {
10fn type_param_list(p: &mut Parser) { 10fn type_param_list(p: &mut Parser) {
11 assert!(p.at(T![<])); 11 assert!(p.at(T![<]));
12 let m = p.start(); 12 let m = p.start();
13 p.bump_any(); 13 p.bump(T![<]);
14 14
15 while !p.at(EOF) && !p.at(T![>]) { 15 while !p.at(EOF) && !p.at(T![>]) {
16 let m = p.start(); 16 let m = p.start();
@@ -38,7 +38,7 @@ fn type_param_list(p: &mut Parser) {
38 38
39fn lifetime_param(p: &mut Parser, m: Marker) { 39fn lifetime_param(p: &mut Parser, m: Marker) {
40 assert!(p.at(LIFETIME)); 40 assert!(p.at(LIFETIME));
41 p.bump_any(); 41 p.bump(LIFETIME);
42 if p.at(T![:]) { 42 if p.at(T![:]) {
43 lifetime_bounds(p); 43 lifetime_bounds(p);
44 } 44 }
@@ -54,7 +54,7 @@ fn type_param(p: &mut Parser, m: Marker) {
54 // test type_param_default 54 // test type_param_default
55 // struct S<T = i32>; 55 // struct S<T = i32>;
56 if p.at(T![=]) { 56 if p.at(T![=]) {
57 p.bump_any(); 57 p.bump(T![=]);
58 types::type_(p) 58 types::type_(p)
59 } 59 }
60 m.complete(p, TYPE_PARAM); 60 m.complete(p, TYPE_PARAM);
@@ -64,15 +64,15 @@ fn type_param(p: &mut Parser, m: Marker) {
64// struct S<T: 'a + ?Sized + (Copy)>; 64// struct S<T: 'a + ?Sized + (Copy)>;
65pub(super) fn bounds(p: &mut Parser) { 65pub(super) fn bounds(p: &mut Parser) {
66 assert!(p.at(T![:])); 66 assert!(p.at(T![:]));
67 p.bump_any(); 67 p.bump(T![:]);
68 bounds_without_colon(p); 68 bounds_without_colon(p);
69} 69}
70 70
71fn lifetime_bounds(p: &mut Parser) { 71fn lifetime_bounds(p: &mut Parser) {
72 assert!(p.at(T![:])); 72 assert!(p.at(T![:]));
73 p.bump_any(); 73 p.bump(T![:]);
74 while p.at(LIFETIME) { 74 while p.at(LIFETIME) {
75 p.bump_any(); 75 p.bump(LIFETIME);
76 if !p.eat(T![+]) { 76 if !p.eat(T![+]) {
77 break; 77 break;
78 } 78 }
@@ -99,7 +99,7 @@ fn type_bound(p: &mut Parser) -> bool {
99 let has_paren = p.eat(T!['(']); 99 let has_paren = p.eat(T!['(']);
100 p.eat(T![?]); 100 p.eat(T![?]);
101 match p.current() { 101 match p.current() {
102 LIFETIME => p.bump_any(), 102 LIFETIME => p.bump(LIFETIME),
103 T![for] => types::for_type(p), 103 T![for] => types::for_type(p),
104 _ if paths::is_use_path_start(p) => types::path_type_(p, false), 104 _ if paths::is_use_path_start(p) => types::path_type_(p, false),
105 _ => { 105 _ => {
@@ -128,7 +128,7 @@ pub(super) fn opt_where_clause(p: &mut Parser) {
128 return; 128 return;
129 } 129 }
130 let m = p.start(); 130 let m = p.start();
131 p.bump_any(); 131 p.bump(T![where]);
132 132
133 while is_where_predicate(p) { 133 while is_where_predicate(p) {
134 where_predicate(p); 134 where_predicate(p);
@@ -166,7 +166,7 @@ fn where_predicate(p: &mut Parser) {
166 let m = p.start(); 166 let m = p.start();
167 match p.current() { 167 match p.current() {
168 LIFETIME => { 168 LIFETIME => {
169 p.bump_any(); 169 p.bump(LIFETIME);
170 if p.at(T![:]) { 170 if p.at(T![:]) {
171 bounds(p); 171 bounds(p);
172 } else { 172 } else {