1
1
error[E0716]: temporary value dropped while borrowed
2
- --> $DIR/promote-not.rs:7 :50
2
+ --> $DIR/promote-not.rs:9 :50
3
3
|
4
4
LL | static mut TEST1: Option<&mut [i32]> = Some(&mut [1, 2, 3]);
5
5
| ----------^^^^^^^^^-
@@ -9,7 +9,7 @@ LL | static mut TEST1: Option<&mut [i32]> = Some(&mut [1, 2, 3]);
9
9
| using this value as a static requires that borrow lasts for `'static`
10
10
11
11
error[E0716]: temporary value dropped while borrowed
12
- --> $DIR/promote-not.rs:10 :18
12
+ --> $DIR/promote-not.rs:12 :18
13
13
|
14
14
LL | let x = &mut [1,2,3];
15
15
| ^^^^^^^ creates a temporary which is freed while still in use
@@ -19,7 +19,7 @@ LL | };
19
19
| - temporary value is freed at the end of this statement
20
20
21
21
error[E0716]: temporary value dropped while borrowed
22
- --> $DIR/promote-not.rs:19 :32
22
+ --> $DIR/promote-not.rs:21 :32
23
23
|
24
24
LL | let _x: &'static () = &foo();
25
25
| ----------- ^^^^^ creates a temporary which is freed while still in use
29
29
| - temporary value is freed at the end of this statement
30
30
31
31
error[E0716]: temporary value dropped while borrowed
32
- --> $DIR/promote-not.rs:27 :29
32
+ --> $DIR/promote-not.rs:29 :29
33
33
|
34
34
LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
35
35
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
39
39
| - temporary value is freed at the end of this statement
40
40
41
41
error[E0716]: temporary value dropped while borrowed
42
- --> $DIR/promote-not.rs:32 :29
42
+ --> $DIR/promote-not.rs:34 :29
43
43
|
44
44
LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
45
45
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
@@ -48,6 +48,16 @@ LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
48
48
LL | };
49
49
| - temporary value is freed at the end of this statement
50
50
51
- error: aborting due to 5 previous errors
51
+ error[E0716]: temporary value dropped while borrowed
52
+ --> $DIR/promote-not.rs:39:29
53
+ |
54
+ LL | let _val: &'static _ = &(Cell::new(1), 2).0;
55
+ | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary which is freed while still in use
56
+ | |
57
+ | type annotation requires that borrow lasts for `'static`
58
+ LL | }
59
+ | - temporary value is freed at the end of this statement
60
+
61
+ error: aborting due to 6 previous errors
52
62
53
63
For more information about this error, try `rustc --explain E0716`.
0 commit comments