fix enum_variant_names depending lint depending on order

This commit is contained in:
jonboh 2023-09-13 20:55:54 +02:00
parent fa6fd8c346
commit c51e2a0f75
3 changed files with 35 additions and 3 deletions

View file

@ -204,4 +204,21 @@ mod allow_attributes_on_variants {
}
}
mod issue11494 {
// variant order should not affect lint
enum Data {
Valid,
Invalid,
DataDependent,
//~^ ERROR: variant name starts with the enum's name
}
enum Datas {
DatasDependent,
//~^ ERROR: variant name starts with the enum's name
Valid,
Invalid,
}
}
fn main() {}

View file

@ -158,5 +158,17 @@ LL | | }
|
= help: remove the postfixes and use full paths to the variants instead of glob imports
error: aborting due to 14 previous errors
error: variant name starts with the enum's name
--> $DIR/enum_variants.rs:212:9
|
LL | DataDependent,
| ^^^^^^^^^^^^^
error: variant name starts with the enum's name
--> $DIR/enum_variants.rs:217:9
|
LL | DatasDependent,
| ^^^^^^^^^^^^^^
error: aborting due to 16 previous errors