2021-01-21 14:48:30 -06:00
|
|
|
// run-rustfix
|
|
|
|
|
|
|
|
#![deny(clippy::exhaustive_enums)]
|
|
|
|
#![allow(unused)]
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
// nop
|
|
|
|
}
|
|
|
|
|
2021-01-21 15:34:44 -06:00
|
|
|
pub enum Exhaustive {
|
2021-01-21 14:48:30 -06:00
|
|
|
Foo,
|
|
|
|
Bar,
|
|
|
|
Baz,
|
|
|
|
Quux(String),
|
|
|
|
}
|
|
|
|
|
2021-01-21 15:34:44 -06:00
|
|
|
// no warning, already non_exhaustive
|
2021-01-21 14:48:30 -06:00
|
|
|
#[non_exhaustive]
|
2021-01-21 15:34:44 -06:00
|
|
|
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 {
|
2021-01-21 14:48:30 -06:00
|
|
|
Foo,
|
|
|
|
Bar,
|
|
|
|
Baz,
|
|
|
|
Quux(String),
|
|
|
|
}
|