1
1
error[E0716]: temporary value dropped while borrowed
2
- --> $DIR/promote-not.rs:8 :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:11 :18
12
+ --> $DIR/promote-not.rs:12 :18
13
13
|
14
14
LL | let x = &mut [1,2,3];
15
15
| ^^^^^^^ creates a temporary value 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:33 :29
22
+ --> $DIR/promote-not.rs:34 :29
23
23
|
24
24
LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
25
25
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -29,7 +29,7 @@ LL | };
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:39 :29
32
+ --> $DIR/promote-not.rs:40 :29
33
33
|
34
34
LL | let _val: &'static _ = &(Cell::new(1), 2).1;
35
35
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -39,7 +39,7 @@ LL | };
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:20 :32
42
+ --> $DIR/promote-not.rs:21 :32
43
43
|
44
44
LL | let _x: &'static () = &foo();
45
45
| ----------- ^^^^^ creates a temporary value which is freed while still in use
49
49
| - temporary value is freed at the end of this statement
50
50
51
51
error[E0716]: temporary value dropped while borrowed
52
- --> $DIR/promote-not.rs:28 :29
52
+ --> $DIR/promote-not.rs:29 :29
53
53
|
54
54
LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
55
55
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
59
59
| - temporary value is freed at the end of this statement
60
60
61
61
error[E0716]: temporary value dropped while borrowed
62
- --> $DIR/promote-not.rs:46 :29
62
+ --> $DIR/promote-not.rs:47 :29
63
63
|
64
64
LL | let _val: &'static _ = &(Cell::new(1), 2).0;
65
65
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
70
70
| - temporary value is freed at the end of this statement
71
71
72
72
error[E0716]: temporary value dropped while borrowed
73
- --> $DIR/promote-not.rs:47 :29
73
+ --> $DIR/promote-not.rs:48 :29
74
74
|
75
75
LL | let _val: &'static _ = &(Cell::new(1), 2).1;
76
76
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
81
81
| - temporary value is freed at the end of this statement
82
82
83
83
error[E0716]: temporary value dropped while borrowed
84
- --> $DIR/promote-not.rs:50 :29
84
+ --> $DIR/promote-not.rs:51 :29
85
85
|
86
86
LL | let _val: &'static _ = &(1/0);
87
87
| ---------- ^^^^^ creates a temporary value which is freed while still in use
92
92
| - temporary value is freed at the end of this statement
93
93
94
94
error[E0716]: temporary value dropped while borrowed
95
- --> $DIR/promote-not.rs:51 :29
95
+ --> $DIR/promote-not.rs:52 :29
96
96
|
97
97
LL | let _val: &'static _ = &(1/(1-1));
98
98
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -103,7 +103,7 @@ LL | }
103
103
| - temporary value is freed at the end of this statement
104
104
105
105
error[E0716]: temporary value dropped while borrowed
106
- --> $DIR/promote-not.rs:52 :29
106
+ --> $DIR/promote-not.rs:53 :29
107
107
|
108
108
LL | let _val: &'static _ = &((1+1)/(1-1));
109
109
| ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -114,7 +114,7 @@ LL | }
114
114
| - temporary value is freed at the end of this statement
115
115
116
116
error[E0716]: temporary value dropped while borrowed
117
- --> $DIR/promote-not.rs:53 :29
117
+ --> $DIR/promote-not.rs:54 :29
118
118
|
119
119
LL | let _val: &'static _ = &(i32::MIN/-1);
120
120
| ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -125,7 +125,7 @@ LL | }
125
125
| - temporary value is freed at the end of this statement
126
126
127
127
error[E0716]: temporary value dropped while borrowed
128
- --> $DIR/promote-not.rs:54 :29
128
+ --> $DIR/promote-not.rs:55 :29
129
129
|
130
130
LL | let _val: &'static _ = &(i32::MIN/(0-1));
131
131
| ---------- ^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -136,7 +136,7 @@ LL | }
136
136
| - temporary value is freed at the end of this statement
137
137
138
138
error[E0716]: temporary value dropped while borrowed
139
- --> $DIR/promote-not.rs:55 :29
139
+ --> $DIR/promote-not.rs:56 :29
140
140
|
141
141
LL | let _val: &'static _ = &(-128i8/-1);
142
142
| ---------- ^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -147,7 +147,7 @@ LL | }
147
147
| - temporary value is freed at the end of this statement
148
148
149
149
error[E0716]: temporary value dropped while borrowed
150
- --> $DIR/promote-not.rs:56 :29
150
+ --> $DIR/promote-not.rs:57 :29
151
151
|
152
152
LL | let _val: &'static _ = &(1%0);
153
153
| ---------- ^^^^^ creates a temporary value which is freed while still in use
@@ -158,7 +158,7 @@ LL | }
158
158
| - temporary value is freed at the end of this statement
159
159
160
160
error[E0716]: temporary value dropped while borrowed
161
- --> $DIR/promote-not.rs:57 :29
161
+ --> $DIR/promote-not.rs:58 :29
162
162
|
163
163
LL | let _val: &'static _ = &(1%(1-1));
164
164
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -169,7 +169,7 @@ LL | }
169
169
| - temporary value is freed at the end of this statement
170
170
171
171
error[E0716]: temporary value dropped while borrowed
172
- --> $DIR/promote-not.rs:58 :29
172
+ --> $DIR/promote-not.rs:59 :29
173
173
|
174
174
LL | let _val: &'static _ = &([1,2,3][4]+1);
175
175
| ---------- ^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -180,7 +180,7 @@ LL | }
180
180
| - temporary value is freed at the end of this statement
181
181
182
182
error[E0716]: temporary value dropped while borrowed
183
- --> $DIR/promote-not.rs:61 :29
183
+ --> $DIR/promote-not.rs:62 :29
184
184
|
185
185
LL | let _val: &'static _ = &TEST_DROP;
186
186
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -191,7 +191,7 @@ LL | }
191
191
| - temporary value is freed at the end of this statement
192
192
193
193
error[E0716]: temporary value dropped while borrowed
194
- --> $DIR/promote-not.rs:63 :29
194
+ --> $DIR/promote-not.rs:64 :29
195
195
|
196
196
LL | let _val: &'static _ = &&TEST_DROP;
197
197
| ---------- ^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -202,7 +202,7 @@ LL | }
202
202
| - temporary value is freed at the end of this statement
203
203
204
204
error[E0716]: temporary value dropped while borrowed
205
- --> $DIR/promote-not.rs:63 :30
205
+ --> $DIR/promote-not.rs:64 :30
206
206
|
207
207
LL | let _val: &'static _ = &&TEST_DROP;
208
208
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -213,7 +213,7 @@ LL | }
213
213
| - temporary value is freed at the end of this statement
214
214
215
215
error[E0716]: temporary value dropped while borrowed
216
- --> $DIR/promote-not.rs:66 :29
216
+ --> $DIR/promote-not.rs:67 :29
217
217
|
218
218
LL | let _val: &'static _ = &(&TEST_DROP,);
219
219
| ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -224,7 +224,7 @@ LL | }
224
224
| - temporary value is freed at the end of this statement
225
225
226
226
error[E0716]: temporary value dropped while borrowed
227
- --> $DIR/promote-not.rs:66 :31
227
+ --> $DIR/promote-not.rs:67 :31
228
228
|
229
229
LL | let _val: &'static _ = &(&TEST_DROP,);
230
230
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -235,7 +235,7 @@ LL | }
235
235
| - temporary value is freed at the end of this statement
236
236
237
237
error[E0716]: temporary value dropped while borrowed
238
- --> $DIR/promote-not.rs:69 :29
238
+ --> $DIR/promote-not.rs:70 :29
239
239
|
240
240
LL | let _val: &'static _ = &[&TEST_DROP; 1];
241
241
| ---------- ^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -246,14 +246,25 @@ LL | }
246
246
| - temporary value is freed at the end of this statement
247
247
248
248
error[E0716]: temporary value dropped while borrowed
249
- --> $DIR/promote-not.rs:69 :31
249
+ --> $DIR/promote-not.rs:70 :31
250
250
|
251
251
LL | let _val: &'static _ = &[&TEST_DROP; 1];
252
252
| ---------- ^^^^^^^^^ - temporary value is freed at the end of this statement
253
253
| | |
254
254
| | creates a temporary value which is freed while still in use
255
255
| type annotation requires that borrow lasts for `'static`
256
256
257
- error: aborting due to 24 previous errors
257
+ error[E0716]: temporary value dropped while borrowed
258
+ --> $DIR/promote-not.rs:79:26
259
+ |
260
+ LL | let x: &'static _ = &UnionWithCell { f1: 0 };
261
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
262
+ | |
263
+ | type annotation requires that borrow lasts for `'static`
264
+ LL |
265
+ LL | }
266
+ | - temporary value is freed at the end of this statement
267
+
268
+ error: aborting due to 25 previous errors
258
269
259
270
For more information about this error, try `rustc --explain E0716`.
0 commit comments