]> git.lizzy.rs Git - rust.git/blob - tests/ui/enum_variants.rs
Auto merge of #68717 - petrochenkov:stabexpat, r=varkor
[rust.git] / tests / ui / enum_variants.rs
1 #![feature(non_ascii_idents)]
2 #![warn(clippy::enum_variant_names, clippy::pub_enum_variant_names)]
3 #![allow(non_camel_case_types)]
4
5 enum FakeCallType {
6     CALL,
7     CREATE,
8 }
9
10 enum FakeCallType2 {
11     CALL,
12     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 {
43     // no error
44     CallTypeCall,
45     CallTypeCreate,
46 }
47
48 enum Consts {
49     ConstantInt,
50     ConstantCake,
51     ConstantLie,
52 }
53
54 enum Two {
55     // no error here
56     ConstantInt,
57     ConstantInfer,
58 }
59
60 enum Something {
61     CCall,
62     CCreate,
63     CCryogenize,
64 }
65
66 enum Seal {
67     With,
68     Without,
69 }
70
71 enum Seall {
72     With,
73     WithOut,
74     Withbroken,
75 }
76
77 enum Sealll {
78     With,
79     WithOut,
80 }
81
82 enum Seallll {
83     WithOutCake,
84     WithOutTea,
85     WithOut,
86 }
87
88 enum NonCaps {
89     Prefixçš„,
90     PrefixTea,
91     PrefixCake,
92 }
93
94 pub enum PubSeall {
95     WithOutCake,
96     WithOutTea,
97     WithOut,
98 }
99
100 #[allow(clippy::pub_enum_variant_names)]
101 mod allowed {
102     pub enum PubAllowed {
103         SomeThis,
104         SomeThat,
105         SomeOtherWhat,
106     }
107 }
108
109 // should not lint
110 enum Pat {
111     Foo,
112     Bar,
113     Path,
114 }
115
116 // should not lint
117 enum N {
118     Pos,
119     Neg,
120     Float,
121 }
122
123 // should not lint
124 enum Peek {
125     Peek1,
126     Peek2,
127     Peek3,
128 }
129
130 // should not lint
131 pub enum NetworkLayer {
132     Layer2,
133     Layer3,
134 }
135
136 fn main() {}