rust/tests/ui/pattern/usefulness/issue-13727.rs
2023-01-11 09:32:08 +00:00

16 lines
256 B
Rust

#![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);
}