1 // FIXME: missing sysroot spans (#53081)
2 // ignore-i586-unknown-linux-gnu
3 // ignore-i586-unknown-linux-musl
4 // ignore-i686-unknown-linux-musl
6 use self::Direction::{North, East, South, West};
8 #[derive(PartialEq, Eq)]
11 #[derive(PartialEq, Eq)]
19 const TRUE_TRUE: (bool, bool) = (true, true);
21 fn nonexhaustive_1() {
23 //~^ ERROR non-exhaustive patterns: `(true, false)` not covered
30 const NONE: Option<Direction> = None;
31 const EAST: Direction = East;
33 fn nonexhaustive_2() {
34 match Some(Some(North)) {
35 //~^ ERROR non-exhaustive patterns: `Some(Some(West))` not covered
37 Some(Some(North)) => (),
38 Some(Some(EAST)) => (),
39 Some(Some(South)) => (),
44 const NEW_FALSE: NewBool = NewBool(false);
46 bar: Option<Direction>,
50 const STATIC_FOO: Foo = Foo { bar: None, baz: NEW_FALSE };
52 fn nonexhaustive_3() {
53 match (Foo { bar: Some(North), baz: NewBool(true) }) {
54 //~^ ERROR non-exhaustive patterns: `Foo { bar: Some(North), baz: NewBool(true) }`
55 Foo { bar: None, baz: NewBool(true) } => (),
56 Foo { bar: _, baz: NEW_FALSE } => (),
57 Foo { bar: Some(West), baz: NewBool(true) } => (),
58 Foo { bar: Some(South), .. } => (),
59 Foo { bar: Some(EAST), .. } => ()