aboutsummaryrefslogtreecommitdiff
path: root/crates/parser/src/grammar/types.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/parser/src/grammar/types.rs')
-rw-r--r--crates/parser/src/grammar/types.rs20
1 files changed, 10 insertions, 10 deletions
diff --git a/crates/parser/src/grammar/types.rs b/crates/parser/src/grammar/types.rs
index 0aa173a52..c876545f4 100644
--- a/crates/parser/src/grammar/types.rs
+++ b/crates/parser/src/grammar/types.rs
@@ -32,11 +32,11 @@ fn type_with_bounds_cond(p: &mut Parser, allow_bounds: bool) {
32 match p.current() { 32 match p.current() {
33 T!['('] => paren_or_tuple_type(p), 33 T!['('] => paren_or_tuple_type(p),
34 T![!] => never_type(p), 34 T![!] => never_type(p),
35 T![*] => pointer_type(p), 35 T![*] => ptr_type(p),
36 T!['['] => array_or_slice_type(p), 36 T!['['] => array_or_slice_type(p),
37 T![&] => reference_type(p), 37 T![&] => ref_type(p),
38 T![_] => placeholder_type(p), 38 T![_] => infer_type(p),
39 T![fn] | T![unsafe] | T![extern] => fn_pointer_type(p), 39 T![fn] | T![unsafe] | T![extern] => fn_ptr_type(p),
40 T![for] => for_type(p), 40 T![for] => for_type(p),
41 T![impl] => impl_trait_type(p), 41 T![impl] => impl_trait_type(p),
42 T![dyn] => dyn_trait_type(p), 42 T![dyn] => dyn_trait_type(p),
@@ -96,7 +96,7 @@ fn never_type(p: &mut Parser) {
96 m.complete(p, NEVER_TYPE); 96 m.complete(p, NEVER_TYPE);
97} 97}
98 98
99fn pointer_type(p: &mut Parser) { 99fn ptr_type(p: &mut Parser) {
100 assert!(p.at(T![*])); 100 assert!(p.at(T![*]));
101 let m = p.start(); 101 let m = p.start();
102 p.bump(T![*]); 102 p.bump(T![*]);
@@ -156,7 +156,7 @@ fn array_or_slice_type(p: &mut Parser) {
156// type A = &(); 156// type A = &();
157// type B = &'static (); 157// type B = &'static ();
158// type C = &mut (); 158// type C = &mut ();
159fn reference_type(p: &mut Parser) { 159fn ref_type(p: &mut Parser) {
160 assert!(p.at(T![&])); 160 assert!(p.at(T![&]));
161 let m = p.start(); 161 let m = p.start();
162 p.bump(T![&]); 162 p.bump(T![&]);
@@ -168,7 +168,7 @@ fn reference_type(p: &mut Parser) {
168 168
169// test placeholder_type 169// test placeholder_type
170// type Placeholder = _; 170// type Placeholder = _;
171fn placeholder_type(p: &mut Parser) { 171fn infer_type(p: &mut Parser) {
172 assert!(p.at(T![_])); 172 assert!(p.at(T![_]));
173 let m = p.start(); 173 let m = p.start();
174 p.bump(T![_]); 174 p.bump(T![_]);
@@ -180,7 +180,7 @@ fn placeholder_type(p: &mut Parser) {
180// type B = unsafe fn(); 180// type B = unsafe fn();
181// type C = unsafe extern "C" fn(); 181// type C = unsafe extern "C" fn();
182// type D = extern "C" fn ( u8 , ... ) -> u8; 182// type D = extern "C" fn ( u8 , ... ) -> u8;
183fn fn_pointer_type(p: &mut Parser) { 183fn fn_ptr_type(p: &mut Parser) {
184 let m = p.start(); 184 let m = p.start();
185 p.eat(T![unsafe]); 185 p.eat(T![unsafe]);
186 if p.at(T![extern]) { 186 if p.at(T![extern]) {
@@ -200,7 +200,7 @@ fn fn_pointer_type(p: &mut Parser) {
200 } 200 }
201 // test fn_pointer_type_with_ret 201 // test fn_pointer_type_with_ret
202 // type F = fn() -> (); 202 // type F = fn() -> ();
203 opt_fn_ret_type(p); 203 opt_ret_type(p);
204 m.complete(p, FN_PTR_TYPE); 204 m.complete(p, FN_PTR_TYPE);
205} 205}
206 206
@@ -208,7 +208,7 @@ pub(super) fn for_binder(p: &mut Parser) {
208 assert!(p.at(T![for])); 208 assert!(p.at(T![for]));
209 p.bump(T![for]); 209 p.bump(T![for]);
210 if p.at(T![<]) { 210 if p.at(T![<]) {
211 type_params::opt_type_param_list(p); 211 type_params::opt_generic_param_list(p);
212 } else { 212 } else {
213 p.error("expected `<`"); 213 p.error("expected `<`");
214 } 214 }