diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2019-11-11 08:27:38 +0000 |
---|---|---|
committer | GitHub <[email protected]> | 2019-11-11 08:27:38 +0000 |
commit | 8f98f0730394cd30031f8c56132247829166bf18 (patch) | |
tree | 50401900e5b97e1bb40ad1d82c902bc175960cfa /crates/ra_syntax/test_data | |
parent | a09b5b91ae2ce5e59f0fea97d07bf4aa1f550212 (diff) | |
parent | 1860f9ab43acb77c9fdd7ca646ef65e9b008b932 (diff) |
Merge #2207
2207: Forbid visibility qualifiers in traits r=matklad a=matklad
Co-authored-by: Aleksey Kladov <[email protected]>
Diffstat (limited to 'crates/ra_syntax/test_data')
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rs | 6 | ||||
-rw-r--r-- | crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.txt | 99 |
2 files changed, 105 insertions, 0 deletions
diff --git a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rs b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rs new file mode 100644 index 000000000..a43e7ef10 --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.rs | |||
@@ -0,0 +1,6 @@ | |||
1 | impl T for () { | ||
2 | fn foo() {} | ||
3 | pub fn bar() {} | ||
4 | pub(crate) type Baz = (); | ||
5 | pub(crate) const C: i32 = 92; | ||
6 | } | ||
diff --git a/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.txt b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.txt new file mode 100644 index 000000000..749c8cddb --- /dev/null +++ b/crates/ra_syntax/test_data/parser/err/0037_visibility_in_traits.txt | |||
@@ -0,0 +1,99 @@ | |||
1 | SOURCE_FILE@[0; 118) | ||
2 | IMPL_BLOCK@[0; 117) | ||
3 | IMPL_KW@[0; 4) "impl" | ||
4 | WHITESPACE@[4; 5) " " | ||
5 | PATH_TYPE@[5; 6) | ||
6 | PATH@[5; 6) | ||
7 | PATH_SEGMENT@[5; 6) | ||
8 | NAME_REF@[5; 6) | ||
9 | IDENT@[5; 6) "T" | ||
10 | WHITESPACE@[6; 7) " " | ||
11 | FOR_KW@[7; 10) "for" | ||
12 | WHITESPACE@[10; 11) " " | ||
13 | TUPLE_TYPE@[11; 13) | ||
14 | L_PAREN@[11; 12) "(" | ||
15 | R_PAREN@[12; 13) ")" | ||
16 | WHITESPACE@[13; 14) " " | ||
17 | ITEM_LIST@[14; 117) | ||
18 | L_CURLY@[14; 15) "{" | ||
19 | WHITESPACE@[15; 20) "\n " | ||
20 | FN_DEF@[20; 31) | ||
21 | FN_KW@[20; 22) "fn" | ||
22 | WHITESPACE@[22; 23) " " | ||
23 | NAME@[23; 26) | ||
24 | IDENT@[23; 26) "foo" | ||
25 | PARAM_LIST@[26; 28) | ||
26 | L_PAREN@[26; 27) "(" | ||
27 | R_PAREN@[27; 28) ")" | ||
28 | WHITESPACE@[28; 29) " " | ||
29 | BLOCK_EXPR@[29; 31) | ||
30 | BLOCK@[29; 31) | ||
31 | L_CURLY@[29; 30) "{" | ||
32 | R_CURLY@[30; 31) "}" | ||
33 | WHITESPACE@[31; 36) "\n " | ||
34 | FN_DEF@[36; 51) | ||
35 | VISIBILITY@[36; 39) | ||
36 | PUB_KW@[36; 39) "pub" | ||
37 | WHITESPACE@[39; 40) " " | ||
38 | FN_KW@[40; 42) "fn" | ||
39 | WHITESPACE@[42; 43) " " | ||
40 | NAME@[43; 46) | ||
41 | IDENT@[43; 46) "bar" | ||
42 | PARAM_LIST@[46; 48) | ||
43 | L_PAREN@[46; 47) "(" | ||
44 | R_PAREN@[47; 48) ")" | ||
45 | WHITESPACE@[48; 49) " " | ||
46 | BLOCK_EXPR@[49; 51) | ||
47 | BLOCK@[49; 51) | ||
48 | L_CURLY@[49; 50) "{" | ||
49 | R_CURLY@[50; 51) "}" | ||
50 | WHITESPACE@[51; 56) "\n " | ||
51 | TYPE_ALIAS_DEF@[56; 81) | ||
52 | VISIBILITY@[56; 66) | ||
53 | PUB_KW@[56; 59) "pub" | ||
54 | L_PAREN@[59; 60) "(" | ||
55 | CRATE_KW@[60; 65) "crate" | ||
56 | R_PAREN@[65; 66) ")" | ||
57 | WHITESPACE@[66; 67) " " | ||
58 | TYPE_KW@[67; 71) "type" | ||
59 | WHITESPACE@[71; 72) " " | ||
60 | NAME@[72; 75) | ||
61 | IDENT@[72; 75) "Baz" | ||
62 | WHITESPACE@[75; 76) " " | ||
63 | EQ@[76; 77) "=" | ||
64 | WHITESPACE@[77; 78) " " | ||
65 | TUPLE_TYPE@[78; 80) | ||
66 | L_PAREN@[78; 79) "(" | ||
67 | R_PAREN@[79; 80) ")" | ||
68 | SEMI@[80; 81) ";" | ||
69 | WHITESPACE@[81; 86) "\n " | ||
70 | CONST_DEF@[86; 115) | ||
71 | VISIBILITY@[86; 96) | ||
72 | PUB_KW@[86; 89) "pub" | ||
73 | L_PAREN@[89; 90) "(" | ||
74 | CRATE_KW@[90; 95) "crate" | ||
75 | R_PAREN@[95; 96) ")" | ||
76 | WHITESPACE@[96; 97) " " | ||
77 | CONST_KW@[97; 102) "const" | ||
78 | WHITESPACE@[102; 103) " " | ||
79 | NAME@[103; 104) | ||
80 | IDENT@[103; 104) "C" | ||
81 | COLON@[104; 105) ":" | ||
82 | WHITESPACE@[105; 106) " " | ||
83 | PATH_TYPE@[106; 109) | ||
84 | PATH@[106; 109) | ||
85 | PATH_SEGMENT@[106; 109) | ||
86 | NAME_REF@[106; 109) | ||
87 | IDENT@[106; 109) "i32" | ||
88 | WHITESPACE@[109; 110) " " | ||
89 | EQ@[110; 111) "=" | ||
90 | WHITESPACE@[111; 112) " " | ||
91 | LITERAL@[112; 114) | ||
92 | INT_NUMBER@[112; 114) "92" | ||
93 | SEMI@[114; 115) ";" | ||
94 | WHITESPACE@[115; 116) "\n" | ||
95 | R_CURLY@[116; 117) "}" | ||
96 | WHITESPACE@[117; 118) "\n" | ||
97 | error [36; 39): unnecessary visibility qualifier | ||
98 | error [56; 66): unnecessary visibility qualifier | ||
99 | error [86; 96): unnecessary visibility qualifier | ||