2 #![deny(unreachable_patterns)]
4 use self::Direction
::{North, East, South, West}
;
6 #[derive(PartialEq, Eq)]
9 #[derive(PartialEq, Eq)]
17 const TRUE_TRUE
: (bool
, bool
) = (true, true);
26 //~^ ERROR unreachable pattern
30 const NONE
: Option
<Direction
> = None
;
31 const EAST
: Direction
= East
;
34 match Some(Some(North
)) {
36 Some(Some(North
)) => (),
37 Some(Some(EAST
)) => (),
38 Some(Some(South
)) => (),
39 Some(Some(West
)) => (),
40 Some(Some(East
)) => (),
41 //~^ ERROR unreachable pattern
46 const NEW_FALSE
: NewBool
= NewBool(false);
48 bar
: Option
<Direction
>,
53 match (Foo { bar: Some(EAST), baz: NewBool(true) }
) {
54 Foo { bar: None, baz: NewBool(true) }
=> (),
55 Foo { bar: _, baz: NEW_FALSE }
=> (),
56 Foo { bar: Some(West), baz: NewBool(true) }
=> (),
57 Foo { bar: Some(South), .. }
=> (),
58 Foo { bar: Some(EAST), .. }
=> (),
59 Foo { bar: Some(North), baz: NewBool(true) }
=> (),
60 Foo { bar: Some(EAST), baz: NewBool(false) }
=> ()
61 //~^ ERROR unreachable pattern