lint enum variants names that start or end with their enum's name

This commit is contained in:
Oliver Schneider 2016-06-08 15:32:30 +02:00
parent 5726216c9b
commit 32894d503e
No known key found for this signature in database
GPG key ID: 56D6EEA0FC67AC46
2 changed files with 26 additions and 2 deletions

View file

@ -11,7 +11,8 @@ enum FakeCallType2 {
}
enum Foo {
cFoo, cBar,
cFoo, //~ ERROR: Variant name ends with the enum's name
cBar,
}
enum BadCallType { //~ ERROR: All variants have the same prefix: `CallType`
@ -68,4 +69,12 @@ enum NonCaps { //~ ERROR: All variants have the same prefix: `Prefix`
PrefixCake,
}
enum Stuff {
BadStuff, //~ ERROR: Variant name ends with the enum's name
}
enum Food {
FoodGood, //~ ERROR: Variant name starts with the enum's name
}
fn main() {}