Skip to content

Commit 598bed6

Browse files
Ensure test actually uses dataflow, not simulation
1 parent 34ce0ba commit 598bed6

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

src/test/ui/consts/control-flow/interior-mutability.rs

+4
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,10 @@ const Z: Option<Cell<i32>> = {
3030
z = Some(Cell::new(4));
3131
}
3232

33+
if i == 9 {
34+
z = None;
35+
}
36+
3337
i += 1;
3438
}
3539
z

src/test/ui/consts/control-flow/interior-mutability.stderr

+3-3
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error[E0716]: temporary value dropped while borrowed
2-
--> $DIR/interior-mutability.rs:40:26
2+
--> $DIR/interior-mutability.rs:44:26
33
|
44
LL | let x: &'static _ = &X;
55
| ---------- ^ creates a temporary which is freed while still in use
@@ -10,7 +10,7 @@ LL | }
1010
| - temporary value is freed at the end of this statement
1111

1212
error[E0716]: temporary value dropped while borrowed
13-
--> $DIR/interior-mutability.rs:41:26
13+
--> $DIR/interior-mutability.rs:45:26
1414
|
1515
LL | let y: &'static _ = &Y;
1616
| ---------- ^ creates a temporary which is freed while still in use
@@ -21,7 +21,7 @@ LL | }
2121
| - temporary value is freed at the end of this statement
2222

2323
error[E0716]: temporary value dropped while borrowed
24-
--> $DIR/interior-mutability.rs:42:26
24+
--> $DIR/interior-mutability.rs:46:26
2525
|
2626
LL | let z: &'static _ = &Z;
2727
| ---------- ^ creates a temporary which is freed while still in use

0 commit comments

Comments
 (0)