mirror of
https://github.com/rust-lang/rust
synced 2024-11-05 20:45:15 +00:00
25 lines
626 B
Rust
25 lines
626 B
Rust
#![deny(unreachable_patterns)]
|
|
|
|
fn main() {
|
|
let s: &[bool] = &[];
|
|
|
|
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] => {}
|
|
[..] => {}
|
|
}
|
|
}
|