about summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/test/ui/consts/control-flow/interior-mutability.rs4
-rw-r--r--src/test/ui/consts/control-flow/interior-mutability.stderr6
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 @@ const Z: Option<Cell<i32>> = {
             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