]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/usefulness/issue-71930-type-of-match-scrutinee.rs
Auto merge of #78682 - glandium:issue78471, r=lcnr
[rust.git] / src / test / ui / pattern / usefulness / issue-71930-type-of-match-scrutinee.rs
1 // check-pass
2
3 // In PR 71930, it was discovered that the code to retrieve the inferred type of a match scrutinee
4 // was incorrect.
5
6 fn f() -> ! {
7     panic!()
8 }
9
10 fn g() -> usize {
11     match f() { // Should infer type `bool`
12         false => 0,
13         true => 1,
14     }
15 }
16
17 fn h() -> usize {
18     match f() { // Should infer type `!`
19     }
20 }
21
22 fn main() {}