File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
src/test/ui/consts/control-flow Expand file tree Collapse file tree 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>> = {
3030 z = Some ( Cell :: new ( 4 ) ) ;
3131 }
3232
33+ if i == 9 {
34+ z = None ;
35+ }
36+
3337 i += 1 ;
3438 }
3539 z
Original file line number Diff line number Diff line change 11error[E0716]: temporary value dropped while borrowed
2- --> $DIR/interior-mutability.rs:40 :26
2+ --> $DIR/interior-mutability.rs:44 :26
33 |
44LL | let x: &'static _ = &X;
55 | ---------- ^ creates a temporary which is freed while still in use
1010 | - temporary value is freed at the end of this statement
1111
1212error[E0716]: temporary value dropped while borrowed
13- --> $DIR/interior-mutability.rs:41 :26
13+ --> $DIR/interior-mutability.rs:45 :26
1414 |
1515LL | let y: &'static _ = &Y;
1616 | ---------- ^ creates a temporary which is freed while still in use
2121 | - temporary value is freed at the end of this statement
2222
2323error[E0716]: temporary value dropped while borrowed
24- --> $DIR/interior-mutability.rs:42 :26
24+ --> $DIR/interior-mutability.rs:46 :26
2525 |
2626LL | let z: &'static _ = &Z;
2727 | ---------- ^ creates a temporary which is freed while still in use
You can’t perform that action at this time.
0 commit comments