Constants, slice patterns, and exhaustiveness interact in suboptimal ways · Issue #65413 · rust-lang/rust (original) (raw)
#![feature(slice_patterns)]
const C0: &'static [u8] = b"\x00";
fn main() { let x: &[u8] = &[0]; match x { // this code compiles &[] => {}, &[1..=255] => {}, C0 => {}, //~ unreachable pattern (no it's not) &[_, _, ..] => {} } }