diff options
-rw-r--r-- | src/grammar/types.rs | 5 | ||||
-rw-r--r-- | tests/data/parser/inline/0095_path_type_with_bounds.rs | 1 | ||||
-rw-r--r-- | tests/data/parser/inline/0095_path_type_with_bounds.txt | 35 |
3 files changed, 41 insertions, 0 deletions
diff --git a/src/grammar/types.rs b/src/grammar/types.rs index 9e63c9b2a..03a087acd 100644 --- a/src/grammar/types.rs +++ b/src/grammar/types.rs | |||
@@ -203,5 +203,10 @@ fn path_type(p: &mut Parser) { | |||
203 | assert!(paths::is_path_start(p)); | 203 | assert!(paths::is_path_start(p)); |
204 | let m = p.start(); | 204 | let m = p.start(); |
205 | paths::type_path(p); | 205 | paths::type_path(p); |
206 | // test path_type_with_bounds | ||
207 | // fn foo() -> Box<T + 'f> {} | ||
208 | if p.eat(PLUS) { | ||
209 | type_params::bounds_without_colon(p); | ||
210 | } | ||
206 | m.complete(p, PATH_TYPE); | 211 | m.complete(p, PATH_TYPE); |
207 | } | 212 | } |
diff --git a/tests/data/parser/inline/0095_path_type_with_bounds.rs b/tests/data/parser/inline/0095_path_type_with_bounds.rs new file mode 100644 index 000000000..215210e27 --- /dev/null +++ b/tests/data/parser/inline/0095_path_type_with_bounds.rs | |||
@@ -0,0 +1 @@ | |||
fn foo() -> Box<T + 'f> {} | |||
diff --git a/tests/data/parser/inline/0095_path_type_with_bounds.txt b/tests/data/parser/inline/0095_path_type_with_bounds.txt new file mode 100644 index 000000000..aeda229d5 --- /dev/null +++ b/tests/data/parser/inline/0095_path_type_with_bounds.txt | |||
@@ -0,0 +1,35 @@ | |||
1 | FILE@[0; 27) | ||
2 | FN_ITEM@[0; 26) | ||
3 | FN_KW@[0; 2) | ||
4 | WHITESPACE@[2; 3) | ||
5 | NAME@[3; 6) | ||
6 | IDENT@[3; 6) "foo" | ||
7 | PARAM_LIST@[6; 8) | ||
8 | L_PAREN@[6; 7) | ||
9 | R_PAREN@[7; 8) | ||
10 | WHITESPACE@[8; 9) | ||
11 | THIN_ARROW@[9; 11) | ||
12 | WHITESPACE@[11; 12) | ||
13 | PATH_TYPE@[12; 23) | ||
14 | PATH@[12; 23) | ||
15 | PATH_SEGMENT@[12; 23) | ||
16 | NAME_REF@[12; 15) | ||
17 | IDENT@[12; 15) "Box" | ||
18 | TYPE_ARG_LIST@[15; 23) | ||
19 | L_ANGLE@[15; 16) | ||
20 | TYPE_ARG@[16; 22) | ||
21 | PATH_TYPE@[16; 22) | ||
22 | PATH@[16; 17) | ||
23 | PATH_SEGMENT@[16; 17) | ||
24 | NAME_REF@[16; 17) | ||
25 | IDENT@[16; 17) "T" | ||
26 | WHITESPACE@[17; 18) | ||
27 | PLUS@[18; 19) | ||
28 | WHITESPACE@[19; 20) | ||
29 | LIFETIME@[20; 22) "'f" | ||
30 | R_ANGLE@[22; 23) | ||
31 | WHITESPACE@[23; 24) | ||
32 | BLOCK_EXPR@[24; 26) | ||
33 | L_CURLY@[24; 25) | ||
34 | R_CURLY@[25; 26) | ||
35 | WHITESPACE@[26; 27) | ||