5 let x: Result<u32, &'static Void> = Ok(23);
6 let _ = match x { //~ ERROR non-exhaustive
10 // This is pretty much instant UB. However, we have no choice -- we need to
11 // test matching on a reference to `&Void`; we cannot do anything other than
12 // just accept the fact that this is UB if `main` did run, but it doesn't;
13 // this test only checks that these are feature-gated.
14 let x: &Void = unsafe { zeroed() };
15 let _ = match x {}; //~ ERROR non-exhaustive
17 let x: (Void,) = unsafe { zeroed() };
18 let _ = match x {}; //~ ERROR non-exhaustive
20 let x: [Void; 1] = unsafe { zeroed() };
21 let _ = match x {}; //~ ERROR non-exhaustive
23 let x: &[Void] = unsafe { zeroed() };
24 let _ = match x { //~ ERROR non-exhaustive
28 let x: Void = unsafe { zeroed() };
29 let _ = match x {}; // okay
31 let x: Result<u32, Void> = Ok(23);
32 let _ = match x { //~ ERROR non-exhaustive
36 let x: Result<u32, Void> = Ok(23);