2019-11-06 15:27:21 +00:00
|
|
|
#![deny(unreachable_patterns)]
|
|
|
|
|
|
|
|
fn main() {
|
2019-11-17 22:25:51 +00:00
|
|
|
let s: &[bool] = &[];
|
2019-11-06 15:27:21 +00: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] => {}
|
|
|
|
[..] => {}
|
|
|
|
}
|
|
|
|
}
|