mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-10 15:14:29 +00:00
41 lines
507 B
Rust
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),
|
|
}
|