incorrect UB when when a ! place is constructed (but not loaded!) · Issue #117288 · rust-lang/rust (original) (raw)

This code shouldn't have UB but Miri reports UB and rustc generates a SIGILL:

#![feature(never_type)] fn main() { unsafe { let x = 3u8; let x: *const ! = &x as *const u8 as *const _; let _ = *x; } }

Thanks to @Nadrieril for finding this.

Zulip discussion