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