rust/tests/compile-fail/patterns.rs
2015-08-30 19:02:30 +02:00

17 lines
317 B
Rust
Executable File

#![feature(plugin)]
#![plugin(clippy)]
#![allow(unused)]
#![deny(clippy)]
fn main() {
let v = Some(true);
match v {
Some(x) => (),
y @ _ => (), //~ERROR the `y @ _` pattern can be written as just `y`
}
match v {
Some(x) => (),
y @ None => (), // no error
}
}