mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-24 05:33:27 +00:00
26 lines
438 B
Rust
26 lines
438 B
Rust
|
#![feature(plugin)]
|
||
|
#![plugin(clippy)]
|
||
|
|
||
|
#[allow(dead_code)]
|
||
|
enum Baz {
|
||
|
Baz1,
|
||
|
Baz2,
|
||
|
}
|
||
|
|
||
|
struct Test {
|
||
|
t: Option<usize>,
|
||
|
b: Baz,
|
||
|
}
|
||
|
|
||
|
fn main() {
|
||
|
use Baz::*;
|
||
|
let x = Test { t: Some(0), b: Baz1 };
|
||
|
|
||
|
match x {
|
||
|
Test { t: Some(_), b: Baz1 } => unreachable!(),
|
||
|
Test { t: Some(42), b: Baz2 } => unreachable!(),
|
||
|
Test { t: None, .. } => unreachable!(),
|
||
|
Test { .. } => unreachable!(),
|
||
|
}
|
||
|
}
|