We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
MaybeLiveLocals
1 parent 02c2a35 commit 9f9f7f6Copy full SHA for 9f9f7f6
src/test/ui/mir-dataflow/liveness-enum.rs
@@ -0,0 +1,22 @@
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() {}
src/test/ui/mir-dataflow/liveness-enum.stderr
@@ -0,0 +1,10 @@
+error: rustc_peek: bit not set
+ --> $DIR/liveness-enum.rs:15:5
+ |
+LL | rustc_peek(x);
+ | ^^^^^^^^^^^^^
+error: stop_after_dataflow ended compilation
+error: aborting due to 2 previous errors
0 commit comments