File tree 2 files changed +7
-3
lines changed
src/test/ui/consts/control-flow
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -30,6 +30,10 @@ const Z: Option<Cell<i32>> = {
30
30
z = Some ( Cell :: new ( 4 ) ) ;
31
31
}
32
32
33
+ if i == 9 {
34
+ z = None ;
35
+ }
36
+
33
37
i += 1 ;
34
38
}
35
39
z
Original file line number Diff line number Diff line change 1
1
error[E0716]: temporary value dropped while borrowed
2
- --> $DIR/interior-mutability.rs:40 :26
2
+ --> $DIR/interior-mutability.rs:44 :26
3
3
|
4
4
LL | let x: &'static _ = &X;
5
5
| ---------- ^ creates a temporary which is freed while still in use
10
10
| - temporary value is freed at the end of this statement
11
11
12
12
error[E0716]: temporary value dropped while borrowed
13
- --> $DIR/interior-mutability.rs:41 :26
13
+ --> $DIR/interior-mutability.rs:45 :26
14
14
|
15
15
LL | let y: &'static _ = &Y;
16
16
| ---------- ^ creates a temporary which is freed while still in use
21
21
| - temporary value is freed at the end of this statement
22
22
23
23
error[E0716]: temporary value dropped while borrowed
24
- --> $DIR/interior-mutability.rs:42 :26
24
+ --> $DIR/interior-mutability.rs:46 :26
25
25
|
26
26
LL | let z: &'static _ = &Z;
27
27
| ---------- ^ creates a temporary which is freed while still in use
You can’t perform that action at this time.
0 commit comments