rust-clippy/tests/ui/exhaustive_items.rs
2021-01-21 13:39:00 -08:00

41 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),
}