]> git.lizzy.rs Git - rust.git/blob - tests/ui/exhaustive_items.rs
ExhaustiveEnums -> ExhaustiveItems
[rust.git] / tests / ui / exhaustive_items.rs
1 // run-rustfix
2
3 #![deny(clippy::exhaustive_enums)]
4 #![allow(unused)]
5
6 fn main() {
7     // nop
8 }
9
10 pub enum Exhaustive {
11     Foo,
12     Bar,
13     Baz,
14     Quux(String),
15 }
16
17 // no warning, already non_exhaustive
18 #[non_exhaustive]
19 pub enum NonExhaustive {
20     Foo,
21     Bar,
22     Baz,
23     Quux(String),
24 }
25
26 // no warning, private
27 enum ExhaustivePrivate {
28     Foo,
29     Bar,
30     Baz,
31     Quux(String),
32 }
33
34 // no warning, private
35 #[non_exhaustive]
36 enum NonExhaustivePrivate {
37     Foo,
38     Bar,
39     Baz,
40     Quux(String),
41 }