2024-02-16 14:02:50 -06:00
|
|
|
//@ revisions: normal exh_pats
|
|
|
|
//@[normal] check-pass
|
2024-01-18 08:06:46 -06:00
|
|
|
#![feature(never_patterns)]
|
|
|
|
#![allow(incomplete_features)]
|
2024-02-08 04:27:46 -06:00
|
|
|
#![cfg_attr(exh_pats, feature(min_exhaustive_patterns))]
|
2024-01-18 08:06:46 -06:00
|
|
|
#![allow(dead_code, unreachable_code)]
|
|
|
|
#![deny(unreachable_patterns)]
|
|
|
|
|
|
|
|
#[derive(Copy, Clone)]
|
|
|
|
enum Void {}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let res_void: Result<bool, Void> = Ok(true);
|
|
|
|
|
|
|
|
match res_void {
|
|
|
|
Ok(_x) => {}
|
|
|
|
Err(!),
|
|
|
|
//[exh_pats]~^ ERROR unreachable
|
|
|
|
}
|
|
|
|
let (Ok(_x) | Err(!)) = res_void;
|
2024-01-18 07:59:48 -06:00
|
|
|
//[exh_pats]~^ ERROR unreachable
|
2024-01-18 08:06:46 -06:00
|
|
|
if let Err(!) = res_void {}
|
|
|
|
//[exh_pats]~^ ERROR unreachable
|
|
|
|
if let (Ok(true) | Err(!)) = res_void {}
|
|
|
|
//[exh_pats]~^ ERROR unreachable
|
|
|
|
for (Ok(mut _x) | Err(!)) in [res_void] {}
|
|
|
|
//[exh_pats]~^ ERROR unreachable
|
|
|
|
}
|
|
|
|
|
|
|
|
fn foo((Ok(_x) | Err(!)): Result<bool, Void>) {}
|
2024-01-18 07:59:48 -06:00
|
|
|
//[exh_pats]~^ ERROR unreachable
|