From 598bed6f5124ceef83d69256d7e15ec404dda439 Mon Sep 17 00:00:00 2001 From: Dylan MacKenzie Date: Wed, 11 Dec 2019 13:09:20 -0800 Subject: [PATCH] Ensure test actually uses dataflow, not simulation --- src/test/ui/consts/control-flow/interior-mutability.rs | 4 ++++ src/test/ui/consts/control-flow/interior-mutability.stderr | 6 +++--- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/test/ui/consts/control-flow/interior-mutability.rs b/src/test/ui/consts/control-flow/interior-mutability.rs index d064041134f..c2439f4a7bf 100644 --- a/src/test/ui/consts/control-flow/interior-mutability.rs +++ b/src/test/ui/consts/control-flow/interior-mutability.rs @@ -30,6 +30,10 @@ z = Some(Cell::new(4)); } + if i == 9 { + z = None; + } + i += 1; } z diff --git a/src/test/ui/consts/control-flow/interior-mutability.stderr b/src/test/ui/consts/control-flow/interior-mutability.stderr index 4f9c7d34c35..0977c84d12d 100644 --- a/src/test/ui/consts/control-flow/interior-mutability.stderr +++ b/src/test/ui/consts/control-flow/interior-mutability.stderr @@ -1,5 +1,5 @@ error[E0716]: temporary value dropped while borrowed - --> $DIR/interior-mutability.rs:40:26 + --> $DIR/interior-mutability.rs:44:26 | LL | let x: &'static _ = &X; | ---------- ^ creates a temporary which is freed while still in use @@ -10,7 +10,7 @@ LL | } | - temporary value is freed at the end of this statement error[E0716]: temporary value dropped while borrowed - --> $DIR/interior-mutability.rs:41:26 + --> $DIR/interior-mutability.rs:45:26 | LL | let y: &'static _ = &Y; | ---------- ^ creates a temporary which is freed while still in use @@ -21,7 +21,7 @@ LL | } | - temporary value is freed at the end of this statement error[E0716]: temporary value dropped while borrowed - --> $DIR/interior-mutability.rs:42:26 + --> $DIR/interior-mutability.rs:46:26 | LL | let z: &'static _ = &Z; | ---------- ^ creates a temporary which is freed while still in use