1
Fork 0

Only assume Stacked Borrows if -Zunsound-mir-opts is given

This commit is contained in:
Jannis Christopher Köhl 2022-10-07 01:10:10 +02:00
parent 111324e17c
commit 3c0f3b04b5
7 changed files with 137 additions and 86 deletions

View file

@ -1,8 +1,8 @@
// unit-test: DataflowConstProp
// compile-flags: -Zunsound-mir-opts
// EMIT_MIR if.main.DataflowConstProp.diff
fn main() {
// This does not work (yet). Needs perhaps additional state to track unreachability.
let a = 1;
let b = if *&a == 1 { 2 } else { 3 };
let c = b + 1;