Skip to content

Commit 04728ad

Browse files
committed
update with upstream ui-toml test
1 parent 7d58807 commit 04728ad

File tree

8 files changed

+65
-17
lines changed

8 files changed

+65
-17
lines changed

tests/ui-toml/enum_variant_names/clippy.toml

Lines changed: 0 additions & 1 deletion
This file was deleted.

tests/ui-toml/enum_variant_names/enum_variant_names.rs

Lines changed: 0 additions & 16 deletions
This file was deleted.
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
item-name-threshold = 5
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
struct Data {
2+
a_data: u8,
3+
b_data: u8,
4+
c_data: u8,
5+
d_data: u8,
6+
}
7+
struct Data2 {
8+
//~^ ERROR: all fields have the same postfix
9+
a_data: u8,
10+
b_data: u8,
11+
c_data: u8,
12+
d_data: u8,
13+
e_data: u8,
14+
}
15+
enum Foo {
16+
AFoo,
17+
BFoo,
18+
CFoo,
19+
DFoo,
20+
}
21+
enum Foo2 {
22+
//~^ ERROR: all variants have the same postfix
23+
AFoo,
24+
BFoo,
25+
CFoo,
26+
DFoo,
27+
EFoo,
28+
}
29+
30+
fn main() {}
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
error: all fields have the same postfix: `data`
2+
--> $DIR/item_names.rs:7:1
3+
|
4+
LL | / struct Data2 {
5+
LL | |
6+
LL | | a_data: u8,
7+
LL | | b_data: u8,
8+
... |
9+
LL | | e_data: u8,
10+
LL | | }
11+
| |_^
12+
|
13+
= help: remove the postfixes
14+
= note: `-D clippy::struct-field-names` implied by `-D warnings`
15+
= help: to override `-D warnings` add `#[allow(clippy::struct_field_names)]`
16+
17+
error: all variants have the same postfix: `Foo`
18+
--> $DIR/item_names.rs:21:1
19+
|
20+
LL | / enum Foo2 {
21+
LL | |
22+
LL | | AFoo,
23+
LL | | BFoo,
24+
... |
25+
LL | | EFoo,
26+
LL | | }
27+
| |_^
28+
|
29+
= help: remove the postfixes and use full paths to the variants instead of glob imports
30+
= note: `-D clippy::enum-variant-names` implied by `-D warnings`
31+
= help: to override `-D warnings` add `#[allow(clippy::enum_variant_names)]`
32+
33+
error: aborting due to 2 previous errors
34+

0 commit comments

Comments
 (0)