rust/tests/compile-fail/validity/uninit_float.rs

9 lines
348 B
Rust
Raw Normal View History

// 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() };
2022-05-20 11:11:31 -05:00
//~^ ERROR type validation failed at .value: encountered uninitialized bytes, but expected initialized bytes
}