]>
git.proxmox.com Git - rustc.git/blob - tests/ui/mir-dataflow/uninits-2.rs
1 // General test of maybe_uninits state computed by MIR dataflow.
3 #![feature(core_intrinsics, rustc_attrs)]
5 use std
::intrinsics
::rustc_peek
;
6 use std
::mem
::{drop, replace}
;
10 #[rustc_mir(rustc_peek_maybe_uninit,stop_after_dataflow)]
12 // `x` is initialized here, so maybe-uninit bit is 0.
14 rustc_peek(&x
); //~ ERROR rustc_peek: bit not set
18 // `x` definitely uninitialized here, so maybe-uninit bit is 1.