mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-25 16:24:46 +00:00
bouds in types
This commit is contained in:
parent
5e0fbd5964
commit
99f6976b20
@ -203,5 +203,10 @@ fn path_type(p: &mut Parser) {
|
||||
assert!(paths::is_path_start(p));
|
||||
let m = p.start();
|
||||
paths::type_path(p);
|
||||
// test path_type_with_bounds
|
||||
// fn foo() -> Box<T + 'f> {}
|
||||
if p.eat(PLUS) {
|
||||
type_params::bounds_without_colon(p);
|
||||
}
|
||||
m.complete(p, PATH_TYPE);
|
||||
}
|
||||
|
1
tests/data/parser/inline/0095_path_type_with_bounds.rs
Normal file
1
tests/data/parser/inline/0095_path_type_with_bounds.rs
Normal file
@ -0,0 +1 @@
|
||||
fn foo() -> Box<T + 'f> {}
|
35
tests/data/parser/inline/0095_path_type_with_bounds.txt
Normal file
35
tests/data/parser/inline/0095_path_type_with_bounds.txt
Normal file
@ -0,0 +1,35 @@
|
||||
FILE@[0; 27)
|
||||
FN_ITEM@[0; 26)
|
||||
FN_KW@[0; 2)
|
||||
WHITESPACE@[2; 3)
|
||||
NAME@[3; 6)
|
||||
IDENT@[3; 6) "foo"
|
||||
PARAM_LIST@[6; 8)
|
||||
L_PAREN@[6; 7)
|
||||
R_PAREN@[7; 8)
|
||||
WHITESPACE@[8; 9)
|
||||
THIN_ARROW@[9; 11)
|
||||
WHITESPACE@[11; 12)
|
||||
PATH_TYPE@[12; 23)
|
||||
PATH@[12; 23)
|
||||
PATH_SEGMENT@[12; 23)
|
||||
NAME_REF@[12; 15)
|
||||
IDENT@[12; 15) "Box"
|
||||
TYPE_ARG_LIST@[15; 23)
|
||||
L_ANGLE@[15; 16)
|
||||
TYPE_ARG@[16; 22)
|
||||
PATH_TYPE@[16; 22)
|
||||
PATH@[16; 17)
|
||||
PATH_SEGMENT@[16; 17)
|
||||
NAME_REF@[16; 17)
|
||||
IDENT@[16; 17) "T"
|
||||
WHITESPACE@[17; 18)
|
||||
PLUS@[18; 19)
|
||||
WHITESPACE@[19; 20)
|
||||
LIFETIME@[20; 22) "'f"
|
||||
R_ANGLE@[22; 23)
|
||||
WHITESPACE@[23; 24)
|
||||
BLOCK_EXPR@[24; 26)
|
||||
L_CURLY@[24; 25)
|
||||
R_CURLY@[25; 26)
|
||||
WHITESPACE@[26; 27)
|
Loading…
Reference in New Issue
Block a user