Add test
This commit is contained in:
parent
b202532608
commit
03f0ca0cf4
@ -77,10 +77,17 @@ fn main() {
|
|||||||
(false | true, false | true) => {}
|
(false | true, false | true) => {}
|
||||||
}
|
}
|
||||||
match (true, true) {
|
match (true, true) {
|
||||||
(true, false) => {}
|
(true, true) => {}
|
||||||
(false, true) => {}
|
(false, false) => {}
|
||||||
(false | true, false | true) => {}
|
(false | true, false | true) => {}
|
||||||
}
|
}
|
||||||
|
// https://github.com/rust-lang/rust/issues/76836
|
||||||
|
match None {
|
||||||
|
Some(false) => {}
|
||||||
|
None | Some(true
|
||||||
|
| false) => {} // expected unreachable warning here
|
||||||
|
}
|
||||||
|
|
||||||
// A subpattern that is unreachable in all branches is overall unreachable.
|
// A subpattern that is unreachable in all branches is overall unreachable.
|
||||||
match (true, true) {
|
match (true, true) {
|
||||||
(false, true) => {}
|
(false, true) => {}
|
||||||
|
@ -101,13 +101,13 @@ LL | Some(0
|
|||||||
| ^
|
| ^
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
--> $DIR/exhaustiveness-unreachable-pattern.rs:89:15
|
--> $DIR/exhaustiveness-unreachable-pattern.rs:96:15
|
||||||
|
|
|
|
||||||
LL | | true) => {}
|
LL | | true) => {}
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
|
||||||
error: unreachable pattern
|
error: unreachable pattern
|
||||||
--> $DIR/exhaustiveness-unreachable-pattern.rs:95:15
|
--> $DIR/exhaustiveness-unreachable-pattern.rs:102:15
|
||||||
|
|
|
|
||||||
LL | | true,
|
LL | | true,
|
||||||
| ^^^^
|
| ^^^^
|
||||||
|
Loading…
Reference in New Issue
Block a user