1 use self::Direction
::{North, East, South, West}
;
3 #[derive(PartialEq, Eq)]
6 #[derive(PartialEq, Eq)]
14 const TRUE_TRUE
: (bool
, bool
) = (true, true);
16 fn nonexhaustive_1() {
18 //~^ ERROR non-exhaustive patterns: `(true, false)` not covered
25 const NONE
: Option
<Direction
> = None
;
26 const EAST
: Direction
= East
;
28 fn nonexhaustive_2() {
29 match Some(Some(North
)) {
30 //~^ ERROR non-exhaustive patterns: `Some(Some(West))` not covered
32 Some(Some(North
)) => (),
33 Some(Some(EAST
)) => (),
34 Some(Some(South
)) => (),
39 const NEW_FALSE
: NewBool
= NewBool(false);
41 bar
: Option
<Direction
>,
45 const STATIC_FOO
: Foo
= Foo { bar: None, baz: NEW_FALSE }
;
47 fn nonexhaustive_3() {
48 match (Foo { bar: Some(North), baz: NewBool(true) }
) {
49 //~^ ERROR non-exhaustive patterns: `Foo { bar: Some(North), baz: NewBool(true) }`
50 Foo { bar: None, baz: NewBool(true) }
=> (),
51 Foo { bar: _, baz: NEW_FALSE }
=> (),
52 Foo { bar: Some(West), baz: NewBool(true) }
=> (),
53 Foo { bar: Some(South), .. }
=> (),
54 Foo { bar: Some(EAST), .. }
=> ()