about summary refs log tree commit diff
path: root/src/tools/miri/tests/fail/validity/invalid_int_op.rs
blob: 2435a87a6f28cc5ba68f063a84c9afd05c99bcd7 (plain)
1
2
3
4
5
6
7
8
9
#![allow(invalid_value)]
// Validation makes this fail in the wrong place
// Make sure we find these even with many checks disabled.
//@compile-flags: -Zmiri-disable-alignment-check -Zmiri-disable-stacked-borrows -Zmiri-disable-validation

fn main() {
    let i = unsafe { std::mem::MaybeUninit::<i32>::uninit().assume_init() }; //~ ERROR: uninitialized
    let _x = i + 0;
}