Open
Description
I tried this code:
#![feature(never_type)]
fn main() {
let x: !;
match x {
_ if { loop {} } => (),
}
}
I expected to see this happen: complain about the uninitialized binding x
.
Like it does in https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=99dc49582c1bce26b084e33bfd366026
Instead, this happened: error E0004: non-exhaustive patterns: ()
not covered
A match on a scrutinee of type !
should not expect a pattern of type ()
.
Meta
rustc --version --verbose
:
rustc 1.71.1 (eb26296b5 2023-08-03)
binary: rustc
commit-hash: eb26296b556cef10fb713a38f3d16b9886080f26
commit-date: 2023-08-03
host: x86_64-unknown-linux-gnu
release: 1.71.1
LLVM version: 16.0.5