diff options
author | Aleksey Kladov <[email protected]> | 2018-07-31 16:24:30 +0100 |
---|---|---|
committer | Aleksey Kladov <[email protected]> | 2018-07-31 16:24:30 +0100 |
commit | cd814fdf8113bc801b735ed462ba142e98f1f81b (patch) | |
tree | 07d131346f583ccdbc24fb5ebe81fa69d21290e5 /tests | |
parent | 892acc5b36552995515f91d2bc14ae82f81d7b8d (diff) |
trait bounds
Diffstat (limited to 'tests')
-rw-r--r-- | tests/data/parser/inline/0055_self_param.txt | 77 | ||||
-rw-r--r-- | tests/data/parser/inline/0056_trait_item.rs | 1 | ||||
-rw-r--r-- | tests/data/parser/inline/0056_trait_item.txt | 36 | ||||
-rw-r--r-- | tests/data/parser/inline/0057_auto_trait.rs | 1 | ||||
-rw-r--r-- | tests/data/parser/inline/0057_auto_trait.txt | 12 |
5 files changed, 127 insertions, 0 deletions
diff --git a/tests/data/parser/inline/0055_self_param.txt b/tests/data/parser/inline/0055_self_param.txt new file mode 100644 index 000000000..70aa81207 --- /dev/null +++ b/tests/data/parser/inline/0055_self_param.txt | |||
@@ -0,0 +1,77 @@ | |||
1 | FILE@[0; 80) | ||
2 | IMPL_ITEM@[0; 80) | ||
3 | IMPL_KW@[0; 4) | ||
4 | PATH_TYPE@[4; 7) | ||
5 | PATH@[4; 7) | ||
6 | PATH_SEGMENT@[4; 7) | ||
7 | NAME_REF@[4; 7) | ||
8 | WHITESPACE@[4; 5) | ||
9 | IDENT@[5; 6) "S" | ||
10 | WHITESPACE@[6; 7) | ||
11 | L_CURLY@[7; 8) | ||
12 | FN_ITEM@[8; 31) | ||
13 | WHITESPACE@[8; 13) | ||
14 | FN_KW@[13; 15) | ||
15 | NAME@[15; 17) | ||
16 | WHITESPACE@[15; 16) | ||
17 | IDENT@[16; 17) "a" | ||
18 | PARAM_LIST@[17; 24) | ||
19 | L_PAREN@[17; 18) | ||
20 | SELF_PARAM@[18; 22) | ||
21 | SELF_KW@[18; 22) | ||
22 | R_PAREN@[22; 23) | ||
23 | WHITESPACE@[23; 24) | ||
24 | BLOCK@[24; 31) | ||
25 | L_CURLY@[24; 25) | ||
26 | R_CURLY@[25; 26) | ||
27 | WHITESPACE@[26; 31) | ||
28 | FN_ITEM@[31; 51) | ||
29 | FN_KW@[31; 33) | ||
30 | NAME@[33; 35) | ||
31 | WHITESPACE@[33; 34) | ||
32 | IDENT@[34; 35) "b" | ||
33 | PARAM_LIST@[35; 44) | ||
34 | L_PAREN@[35; 36) | ||
35 | SELF_PARAM@[36; 41) | ||
36 | AMPERSAND@[36; 37) | ||
37 | SELF_KW@[37; 41) | ||
38 | COMMA@[41; 42) | ||
39 | R_PAREN@[42; 43) | ||
40 | WHITESPACE@[43; 44) | ||
41 | BLOCK@[44; 51) | ||
42 | L_CURLY@[44; 45) | ||
43 | R_CURLY@[45; 46) | ||
44 | WHITESPACE@[46; 51) | ||
45 | FN_ITEM@[51; 78) | ||
46 | FN_KW@[51; 53) | ||
47 | NAME@[53; 55) | ||
48 | WHITESPACE@[53; 54) | ||
49 | IDENT@[54; 55) "c" | ||
50 | PARAM_LIST@[55; 75) | ||
51 | L_PAREN@[55; 56) | ||
52 | SELF_PARAM@[56; 65) | ||
53 | AMPERSAND@[56; 57) | ||
54 | MUT_KW@[57; 60) | ||
55 | WHITESPACE@[60; 61) | ||
56 | SELF_KW@[61; 65) | ||
57 | COMMA@[65; 66) | ||
58 | VALUE_PARAMETER@[66; 73) | ||
59 | BIND_PAT@[66; 68) | ||
60 | NAME@[66; 68) | ||
61 | WHITESPACE@[66; 67) | ||
62 | IDENT@[67; 68) "x" | ||
63 | COLON@[68; 69) | ||
64 | PATH_TYPE@[69; 73) | ||
65 | PATH@[69; 73) | ||
66 | PATH_SEGMENT@[69; 73) | ||
67 | NAME_REF@[69; 73) | ||
68 | WHITESPACE@[69; 70) | ||
69 | IDENT@[70; 73) "i32" | ||
70 | R_PAREN@[73; 74) | ||
71 | WHITESPACE@[74; 75) | ||
72 | BLOCK@[75; 78) | ||
73 | L_CURLY@[75; 76) | ||
74 | R_CURLY@[76; 77) | ||
75 | WHITESPACE@[77; 78) | ||
76 | R_CURLY@[78; 79) | ||
77 | WHITESPACE@[79; 80) | ||
diff --git a/tests/data/parser/inline/0056_trait_item.rs b/tests/data/parser/inline/0056_trait_item.rs new file mode 100644 index 000000000..4385afca9 --- /dev/null +++ b/tests/data/parser/inline/0056_trait_item.rs | |||
@@ -0,0 +1 @@ | |||
trait T<U>: Hash + Clone where U: Copy {} | |||
diff --git a/tests/data/parser/inline/0056_trait_item.txt b/tests/data/parser/inline/0056_trait_item.txt new file mode 100644 index 000000000..87efc78e9 --- /dev/null +++ b/tests/data/parser/inline/0056_trait_item.txt | |||
@@ -0,0 +1,36 @@ | |||
1 | FILE@[0; 42) | ||
2 | TRAIT_ITEM@[0; 42) | ||
3 | TRAIT_KW@[0; 5) | ||
4 | NAME@[5; 7) | ||
5 | WHITESPACE@[5; 6) | ||
6 | IDENT@[6; 7) "T" | ||
7 | TYPE_PARAM_LIST@[7; 10) | ||
8 | L_ANGLE@[7; 8) | ||
9 | TYPE_PARAM@[8; 9) | ||
10 | IDENT@[8; 9) "U" | ||
11 | R_ANGLE@[9; 10) | ||
12 | COLON@[10; 11) | ||
13 | PATH@[11; 17) | ||
14 | PATH_SEGMENT@[11; 17) | ||
15 | NAME_REF@[11; 17) | ||
16 | WHITESPACE@[11; 12) | ||
17 | IDENT@[12; 16) "Hash" | ||
18 | WHITESPACE@[16; 17) | ||
19 | PLUS@[17; 18) | ||
20 | PATH@[18; 25) | ||
21 | PATH_SEGMENT@[18; 25) | ||
22 | NAME_REF@[18; 25) | ||
23 | WHITESPACE@[18; 19) | ||
24 | IDENT@[19; 24) "Clone" | ||
25 | WHITESPACE@[24; 25) | ||
26 | WHERE_CLAUSE@[25; 39) | ||
27 | WHERE_KW@[25; 30) | ||
28 | WHITESPACE@[30; 31) | ||
29 | IDENT@[31; 32) "U" | ||
30 | COLON@[32; 33) | ||
31 | WHITESPACE@[33; 34) | ||
32 | IDENT@[34; 38) "Copy" | ||
33 | WHITESPACE@[38; 39) | ||
34 | L_CURLY@[39; 40) | ||
35 | R_CURLY@[40; 41) | ||
36 | WHITESPACE@[41; 42) | ||
diff --git a/tests/data/parser/inline/0057_auto_trait.rs b/tests/data/parser/inline/0057_auto_trait.rs new file mode 100644 index 000000000..72adf6035 --- /dev/null +++ b/tests/data/parser/inline/0057_auto_trait.rs | |||
@@ -0,0 +1 @@ | |||
auto trait T {} | |||
diff --git a/tests/data/parser/inline/0057_auto_trait.txt b/tests/data/parser/inline/0057_auto_trait.txt new file mode 100644 index 000000000..9d098f10b --- /dev/null +++ b/tests/data/parser/inline/0057_auto_trait.txt | |||
@@ -0,0 +1,12 @@ | |||
1 | FILE@[0; 16) | ||
2 | TRAIT_ITEM@[0; 16) | ||
3 | AUTO_KW@[0; 4) | ||
4 | WHITESPACE@[4; 5) | ||
5 | TRAIT_KW@[5; 10) | ||
6 | NAME@[10; 13) | ||
7 | WHITESPACE@[10; 11) | ||
8 | IDENT@[11; 12) "T" | ||
9 | WHITESPACE@[12; 13) | ||
10 | L_CURLY@[13; 14) | ||
11 | R_CURLY@[14; 15) | ||
12 | WHITESPACE@[15; 16) | ||