rust/tests/ui/exhaustive_enums.rs
2021-01-21 13:34:44 -08:00

42 lines
507 B
Rust

// run-rustfix
#![deny(clippy::exhaustive_enums)]
#![allow(unused)]
fn main() {
// nop
}
pub enum Exhaustive {
Foo,
Bar,
Baz,
Quux(String),
}
// no warning, already non_exhaustive
#[non_exhaustive]
pub enum NonExhaustive {
Foo,
Bar,
Baz,
Quux(String),
}
// no warning, private
enum ExhaustivePrivate {
Foo,
Bar,
Baz,
Quux(String),
}
// no warning, private
#[non_exhaustive]
enum NonExhaustivePrivate {
Foo,
Bar,
Baz,
Quux(String),
}