rust/tests/ui/pattern/usefulness/issue-13727.rs

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

16 lines
256 B
Rust
Raw Normal View History

#![allow(overflowing_literals)]
#![deny(unreachable_patterns)]
fn test(val: u8) {
match val {
256 => print!("0b1110\n"),
512 => print!("0b1111\n"),
//~^ ERROR: unreachable pattern
_ => print!("fail\n"),
}
}
fn main() {
test(1);
}