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

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

16 lines
228 B
Rust
Raw Normal View History

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