Closed
Description
This code compiles:
fn foo(ptr: *const bool) {
let _ = *ptr;
}
The MIR is empty, i.e., no ptr deref happens.
But this does not:
fn foo(ptr: *const !) {
let _ = *ptr;
}
The MIR is unreachable;
, i.e., the ptr deref conceptually somehow did actually happen.
That is a very strange inconsistency -- the !
type is just yet another type, why does it behave differently here?
Curiously, this does not yield any unreachable
:
fn bar(ptr: *const (i32, !)) { unsafe {
let (x, _) = *ptr;
} }