2019-11-06 09:27:21 -06:00
|
|
|
#![deny(unreachable_patterns)]
|
|
|
|
|
|
|
|
fn main() {
|
2019-11-17 16:25:51 -06:00
|
|
|
let s: &[bool] = &[];
|
2019-11-06 09:27:21 -06:00
|
|
|
|
|
|
|
match s {
|
|
|
|
[true, ..] => {}
|
|
|
|
[true, ..] => {} //~ ERROR unreachable pattern
|
|
|
|
[true] => {} //~ ERROR unreachable pattern
|
|
|
|
[..] => {}
|
|
|
|
}
|
|
|
|
match s {
|
|
|
|
[.., true] => {}
|
|
|
|
[.., true] => {} //~ ERROR unreachable pattern
|
|
|
|
[true] => {} //~ ERROR unreachable pattern
|
|
|
|
[..] => {}
|
|
|
|
}
|
|
|
|
match s {
|
|
|
|
[false, .., true] => {}
|
|
|
|
[false, .., true] => {} //~ ERROR unreachable pattern
|
|
|
|
[false, true] => {} //~ ERROR unreachable pattern
|
|
|
|
[false] => {}
|
|
|
|
[..] => {}
|
|
|
|
}
|
|
|
|
}
|