rust/tests/ui/pattern/usefulness/rustfix-unreachable-pattern.fixed

24 lines
435 B
Rust

//@ run-rustfix
#![feature(never_patterns)]
#![feature(exhaustive_patterns)]
#![allow(incomplete_features)]
#![deny(unreachable_patterns)]
enum Void {}
#[rustfmt::skip]
fn main() {
let res: Result<(), Void> = Ok(());
match res {
Ok(_) => {}
//~ ERROR unreachable
//~ ERROR unreachable
}
match res {
Ok(_x) => {}
//~ ERROR unreachable
//~ ERROR unreachable
}
}