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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

24 lines
435 B
Rust
Raw Normal View History

//@ 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
}
}