2016-11-29 01:10:26 -06:00
|
|
|
#![deny(unreachable_patterns)]
|
2016-10-26 14:38:22 -05:00
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let buf = &[0, 1, 2, 3];
|
|
|
|
|
|
|
|
match buf {
|
|
|
|
b"AAAA" => {},
|
|
|
|
&[0x41, 0x41, 0x41, 0x41] => {} //~ ERROR unreachable pattern
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
match buf {
|
|
|
|
&[0x41, 0x41, 0x41, 0x41] => {}
|
|
|
|
b"AAAA" => {}, //~ ERROR unreachable pattern
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
match buf {
|
|
|
|
&[_, 0x41, 0x41, 0x41] => {},
|
|
|
|
b"AAAA" => {}, //~ ERROR unreachable pattern
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
match buf {
|
|
|
|
&[0x41, .., 0x41] => {}
|
|
|
|
b"AAAA" => {}, //~ ERROR unreachable pattern
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
let buf: &[u8] = buf;
|
|
|
|
|
|
|
|
match buf {
|
|
|
|
b"AAAA" => {},
|
|
|
|
&[0x41, 0x41, 0x41, 0x41] => {} //~ ERROR unreachable pattern
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
match buf {
|
|
|
|
&[0x41, 0x41, 0x41, 0x41] => {}
|
|
|
|
b"AAAA" => {}, //~ ERROR unreachable pattern
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
match buf {
|
|
|
|
&[_, 0x41, 0x41, 0x41] => {},
|
|
|
|
b"AAAA" => {}, //~ ERROR unreachable pattern
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
|
|
|
|
match buf {
|
|
|
|
&[0x41, .., 0x41] => {}
|
|
|
|
b"AAAA" => {}, //~ ERROR unreachable pattern
|
|
|
|
_ => {}
|
|
|
|
}
|
|
|
|
}
|