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