]> git.lizzy.rs Git - rust.git/blob - tests/ui/enum_variants.rs
Adapt ui-tests to the tool_lints
[rust.git] / tests / ui / enum_variants.rs
1 #![feature(tool_lints)]
2
3 #![feature(non_ascii_idents)]
4
5 #![warn(clippy::all, clippy::pub_enum_variant_names)]
6
7 enum FakeCallType {
8     CALL, CREATE
9 }
10
11 enum FakeCallType2 {
12     CALL, CREATELL
13 }
14
15 enum Foo {
16     cFoo,
17     cBar,
18     cBaz,
19 }
20
21 enum Fooo {
22     cFoo, // no error, threshold is 3 variants by default
23     cBar,
24 }
25
26 enum Food {
27     FoodGood,
28     FoodMiddle,
29     FoodBad,
30 }
31
32 enum Stuff {
33     StuffBad, // no error
34 }
35
36 enum BadCallType {
37     CallTypeCall,
38     CallTypeCreate,
39     CallTypeDestroy,
40 }
41
42 enum TwoCallType { // no error
43     CallTypeCall,
44     CallTypeCreate,
45 }
46
47 enum Consts {
48     ConstantInt,
49     ConstantCake,
50     ConstantLie,
51 }
52
53 enum Two { // no error here
54     ConstantInt,
55     ConstantInfer,
56 }
57
58 enum Something {
59     CCall,
60     CCreate,
61     CCryogenize,
62 }
63
64 enum Seal {
65     With,
66     Without,
67 }
68
69 enum Seall {
70     With,
71     WithOut,
72     Withbroken,
73 }
74
75 enum Sealll {
76     With,
77     WithOut,
78 }
79
80 enum Seallll {
81     WithOutCake,
82     WithOutTea,
83     WithOut,
84 }
85
86 enum NonCaps {
87     Prefixçš„,
88     PrefixTea,
89     PrefixCake,
90 }
91
92 pub enum PubSeall {
93     WithOutCake,
94     WithOutTea,
95     WithOut,
96 }
97
98 #[allow(clippy::pub_enum_variant_names)]
99 mod allowed {
100     pub enum PubAllowed {
101         SomeThis,
102         SomeThat,
103         SomeOtherWhat,
104     }
105 }
106
107 // should not lint
108 enum Pat {
109     Foo,
110     Bar,
111     Path,
112 }
113
114 // should not lint
115 enum N {
116     Pos,
117     Neg,
118     Float,
119 }
120
121 fn main() {}