2016-12-11 10:01:12 -06:00
|
|
|
#![allow(dead_code)]
|
|
|
|
#![allow(unused_variables)]
|
|
|
|
#![allow(non_snake_case)]
|
2016-11-29 01:10:26 -06:00
|
|
|
#![deny(unreachable_patterns)]
|
|
|
|
|
2016-12-11 10:01:12 -06:00
|
|
|
#[derive(Clone, Copy)]
|
2016-05-01 14:54:55 -05:00
|
|
|
enum Enum {
|
|
|
|
Var1,
|
|
|
|
Var2,
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
use Enum::*;
|
|
|
|
let s = Var1;
|
|
|
|
match s {
|
|
|
|
Var1 => (),
|
|
|
|
Var3 => (),
|
|
|
|
Var2 => (),
|
|
|
|
//~^ ERROR unreachable pattern
|
|
|
|
};
|
|
|
|
match &s {
|
|
|
|
&Var1 => (),
|
|
|
|
&Var3 => (),
|
|
|
|
&Var2 => (),
|
|
|
|
//~^ ERROR unreachable pattern
|
|
|
|
};
|
|
|
|
let t = (Var1, Var1);
|
|
|
|
match t {
|
|
|
|
(Var1, b) => (),
|
|
|
|
(c, d) => (),
|
|
|
|
anything => ()
|
|
|
|
//~^ ERROR unreachable pattern
|
|
|
|
};
|
|
|
|
}
|