Closed
Description
Summary
Match expressions with no arms should give a value of type !
Reproducer
I tried this code:
pub enum X {}
pub fn foo(x: X) {
let _a: i32 = match x {};
}
pub fn main() {}
Does the code make use of any (1.49) nightly feature ?
- Nightly
Godbolt link
Actual behavior
<source>:4:5: error: mismatched types, expected 'i32' but got '()' [E0308]
4 | let _a: i32 = match x {};
| ^~~ ~~~ ~~~~~
Expected behavior
No error
GCC Version
GCCRS master on godbolt