rust/tests/ui/pattern/usefulness/issue-35609.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

44 lines
777 B
Rust
Raw Normal View History

enum Enum {
A, B, C, D, E, F
}
use Enum::*;
struct S(Enum, ());
struct Sd { x: Enum, y: () }
fn main() {
2017-11-20 12:13:27 +00:00
match (A, ()) { //~ ERROR non-exhaustive
(A, _) => {}
}
2017-11-20 12:13:27 +00:00
match (A, A) { //~ ERROR non-exhaustive
(_, A) => {}
}
2017-11-20 12:13:27 +00:00
match ((A, ()), ()) { //~ ERROR non-exhaustive
((A, ()), _) => {}
}
2017-11-20 12:13:27 +00:00
match ((A, ()), A) { //~ ERROR non-exhaustive
((A, ()), _) => {}
}
2017-11-20 12:13:27 +00:00
match ((A, ()), ()) { //~ ERROR non-exhaustive
((A, _), _) => {}
}
2017-11-20 12:13:27 +00:00
match S(A, ()) { //~ ERROR non-exhaustive
S(A, _) => {}
}
2017-11-20 12:13:27 +00:00
match (Sd { x: A, y: () }) { //~ ERROR non-exhaustive
Sd { x: A, y: _ } => {}
}
2017-11-20 12:13:27 +00:00
match Some(A) { //~ ERROR non-exhaustive
Some(A) => (),
None => ()
}
}