Skip to content

Commit 4578a16

Browse files
committed
Add test for disjunctive patterns
1 parent b82ee57 commit 4578a16

File tree

1 file changed

+24
-0
lines changed

1 file changed

+24
-0
lines changed

src/test/mir-opt/never_type_unreachable.rs

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,13 @@ fn never_match(x: Result<(), !>) {
3737
}
3838
}
3939

40+
fn never_match_disj_patterns() {
41+
let x: Option<!> = None;
42+
match x {
43+
Some(_) | None => {}
44+
}
45+
}
46+
4047
pub fn main() { }
4148

4249
// END RUST SOURCE
@@ -82,3 +89,20 @@ pub fn main() { }
8289
// }
8390
// }
8491
// END rustc.never_match.SimplifyCfg-initial.after.mir
92+
93+
// START rustc.never_match_disj_patterns.SimplifyCfg-initial.after.mir
94+
// fn never_match_disj_patterns() -> () {
95+
// ...
96+
// bb0: {
97+
// ...
98+
// }
99+
// bb1: {
100+
// unreachable;
101+
// }
102+
// bb2: {
103+
// _0 = ();
104+
// StorageDead(_1);
105+
// return;
106+
// }
107+
// }
108+
// END rustc.never_match_disj_patterns.SimplifyCfg-initial.after.mir

0 commit comments

Comments
 (0)