-
Notifications
You must be signed in to change notification settings - Fork 13.6k
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-never_type`#![feature(never_type)]``#![feature(never_type)]`T-langRelevant to the language teamRelevant to the language teamfixed-by-thir-unsafeck`-Z thir-unsafeck` handles this correctly.`-Z thir-unsafeck` handles this correctly.
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;
} }
tesuji, 197g and kornelski
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.F-never_type`#![feature(never_type)]``#![feature(never_type)]`T-langRelevant to the language teamRelevant to the language teamfixed-by-thir-unsafeck`-Z thir-unsafeck` handles this correctly.`-Z thir-unsafeck` handles this correctly.