rust/tests/compile-fail/uninit_float.rs
2021-11-10 11:36:42 -08:00

9 lines
368 B
Rust

// compile-flags: -Zmiri-check-number-validity
// This test is adapted from https://github.com/rust-lang/miri/issues/1340#issue-600900312.
fn main() {
let _val = unsafe { std::mem::MaybeUninit::<f32>::uninit().assume_init() };
//~^ ERROR type validation failed at .value: encountered uninitialized bytes, but expected initialized plain (non-pointer) bytes
}