rust/tests/ui/pattern/usefulness/issue-65413-constants-and-slices-exhaustiveness.rs

16 lines
228 B
Rust
Raw Normal View History

// check-pass
2019-12-29 18:23:42 -06:00
2019-11-17 16:25:51 -06:00
#![deny(unreachable_patterns)]
const C0: &'static [u8] = b"\x00";
fn main() {
let x: &[u8] = &[0];
match x {
&[] => {}
&[1..=255] => {}
C0 => {}
2019-11-17 16:25:51 -06:00
&[_, _, ..] => {}
}
}