Skip to content

Commit df2e4d1

Browse files
committed
update enum_variants test
1 parent c76e2d1 commit df2e4d1

File tree

2 files changed

+33
-15
lines changed

2 files changed

+33
-15
lines changed

tests/ui/enum_variants.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,4 +145,10 @@ enum HIDataRequest {
145145
DeleteUnpubHIData(String),
146146
}
147147

148+
enum North {
149+
Normal,
150+
NoLeft,
151+
NoRight,
152+
}
153+
148154
fn main() {}

tests/ui/enum_variants.stderr

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,18 @@ LL | cFoo,
66
|
77
= note: `-D clippy::enum-variant-names` implied by `-D warnings`
88

9+
error: all variants have the same prefix: `c`
10+
--> $DIR/enum_variants.rs:14:1
11+
|
12+
LL | / enum Foo {
13+
LL | | cFoo,
14+
LL | | cBar,
15+
LL | | cBaz,
16+
LL | | }
17+
| |_^
18+
|
19+
= help: remove the prefixes and use full paths to the variants instead of glob imports
20+
921
error: variant name starts with the enum's name
1022
--> $DIR/enum_variants.rs:26:5
1123
|
@@ -60,31 +72,31 @@ LL | | }
6072
|
6173
= help: remove the prefixes and use full paths to the variants instead of glob imports
6274

63-
error: all variants have the same prefix: `WithOut`
64-
--> $DIR/enum_variants.rs:81:1
75+
error: all variants have the same prefix: `C`
76+
--> $DIR/enum_variants.rs:59:1
6577
|
66-
LL | / enum Seallll {
67-
LL | | WithOutCake,
68-
LL | | WithOutTea,
69-
LL | | WithOut,
78+
LL | / enum Something {
79+
LL | | CCall,
80+
LL | | CCreate,
81+
LL | | CCryogenize,
7082
LL | | }
7183
| |_^
7284
|
7385
= help: remove the prefixes and use full paths to the variants instead of glob imports
7486

75-
error: all variants have the same prefix: `Prefix`
76-
--> $DIR/enum_variants.rs:87:1
87+
error: all variants have the same prefix: `WithOut`
88+
--> $DIR/enum_variants.rs:81:1
7789
|
78-
LL | / enum NonCaps {
79-
LL | | Prefix的,
80-
LL | | PrefixTea,
81-
LL | | PrefixCake,
90+
LL | / enum Seallll {
91+
LL | | WithOutCake,
92+
LL | | WithOutTea,
93+
LL | | WithOut,
8294
LL | | }
8395
| |_^
8496
|
8597
= help: remove the prefixes and use full paths to the variants instead of glob imports
8698

87-
error: all variants have the same postfix: `IData`
99+
error: all variants have the same postfix: `DataI`
88100
--> $DIR/enum_variants.rs:136:1
89101
|
90102
LL | / enum IDataRequest {
@@ -96,7 +108,7 @@ LL | | }
96108
|
97109
= help: remove the postfixes and use full paths to the variants instead of glob imports
98110

99-
error: all variants have the same postfix: `HIData`
111+
error: all variants have the same postfix: `DataIH`
100112
--> $DIR/enum_variants.rs:142:1
101113
|
102114
LL | / enum HIDataRequest {
@@ -108,5 +120,5 @@ LL | | }
108120
|
109121
= help: remove the postfixes and use full paths to the variants instead of glob imports
110122

111-
error: aborting due to 11 previous errors
123+
error: aborting due to 12 previous errors
112124

0 commit comments

Comments
 (0)