]> git.lizzy.rs Git - rust.git/blob - src/test/ui/mir-dataflow/liveness-enum.rs
Merge commit 'dc5423ad448877e33cca28db2f1445c9c4473c75' into clippyup
[rust.git] / src / test / ui / mir-dataflow / liveness-enum.rs
1 #![feature(core_intrinsics, rustc_attrs)]
2
3 use std::intrinsics::rustc_peek;
4
5 #[rustc_mir(rustc_peek_liveness, stop_after_dataflow)]
6 fn foo() -> Option<i32> {
7     let mut x = None;
8
9     // `x` is live here since it is used in the next statement...
10     rustc_peek(x);
11
12     dbg!(x);
13
14     // But not here, since it is overwritten below
15     rustc_peek(x); //~ ERROR rustc_peek: bit not set
16
17     x = Some(4);
18
19     x
20 }
21
22 fn main() {}