1
1
error[E0716]: temporary value dropped while borrowed
2
- --> $DIR/promote-not.rs:9:50
3
- |
4
- LL | static mut TEST1: Option<&mut [i32]> = Some(&mut [1, 2, 3]);
5
- | ----------^^^^^^^^^-
6
- | | | |
7
- | | | temporary value is freed at the end of this statement
8
- | | creates a temporary value which is freed while still in use
9
- | using this value as a static requires that borrow lasts for `'static`
10
-
11
- error[E0716]: temporary value dropped while borrowed
12
- --> $DIR/promote-not.rs:12:18
2
+ --> $DIR/promote-not.rs:11:18
13
3
|
14
4
LL | let x = &mut [1,2,3];
15
5
| ^^^^^^^ creates a temporary value which is freed while still in use
19
9
| - temporary value is freed at the end of this statement
20
10
21
11
error[E0716]: temporary value dropped while borrowed
22
- --> $DIR/promote-not.rs:34 :29
12
+ --> $DIR/promote-not.rs:33 :29
23
13
|
24
14
LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
25
15
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -29,7 +19,7 @@ LL | };
29
19
| - temporary value is freed at the end of this statement
30
20
31
21
error[E0716]: temporary value dropped while borrowed
32
- --> $DIR/promote-not.rs:40 :29
22
+ --> $DIR/promote-not.rs:39 :29
33
23
|
34
24
LL | let _val: &'static _ = &(Cell::new(1), 2).1;
35
25
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -39,7 +29,7 @@ LL | };
39
29
| - temporary value is freed at the end of this statement
40
30
41
31
error[E0493]: destructor of `String` cannot be evaluated at compile-time
42
- --> $DIR/promote-not.rs:47 :14
32
+ --> $DIR/promote-not.rs:46 :14
43
33
|
44
34
LL | let x = &String::new();
45
35
| ^^^^^^^^^^^^^ the destructor for this type cannot be evaluated in constants
@@ -48,7 +38,7 @@ LL | };
48
38
| - value is dropped here
49
39
50
40
error[E0716]: temporary value dropped while borrowed
51
- --> $DIR/promote-not.rs:59 :33
41
+ --> $DIR/promote-not.rs:58 :33
52
42
|
53
43
LL | let _x: &'static u32 = &mk_panic();
54
44
| ------------ ^^^^^^^^^^ creates a temporary value which is freed while still in use
58
48
| - temporary value is freed at the end of this statement
59
49
60
50
error[E0716]: temporary value dropped while borrowed
61
- --> $DIR/promote-not.rs:21 :32
51
+ --> $DIR/promote-not.rs:20 :32
62
52
|
63
53
LL | let _x: &'static () = &foo();
64
54
| ----------- ^^^^^ creates a temporary value which is freed while still in use
68
58
| - temporary value is freed at the end of this statement
69
59
70
60
error[E0716]: temporary value dropped while borrowed
71
- --> $DIR/promote-not.rs:29 :29
61
+ --> $DIR/promote-not.rs:28 :29
72
62
|
73
63
LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
74
64
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
78
68
| - temporary value is freed at the end of this statement
79
69
80
70
error[E0716]: temporary value dropped while borrowed
81
- --> $DIR/promote-not.rs:65 :29
71
+ --> $DIR/promote-not.rs:64 :29
82
72
|
83
73
LL | let _val: &'static _ = &(Cell::new(1), 2).0;
84
74
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
89
79
| - temporary value is freed at the end of this statement
90
80
91
81
error[E0716]: temporary value dropped while borrowed
92
- --> $DIR/promote-not.rs:66 :29
82
+ --> $DIR/promote-not.rs:65 :29
93
83
|
94
84
LL | let _val: &'static _ = &(Cell::new(1), 2).1;
95
85
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -100,7 +90,7 @@ LL | }
100
90
| - temporary value is freed at the end of this statement
101
91
102
92
error[E0716]: temporary value dropped while borrowed
103
- --> $DIR/promote-not.rs:69 :29
93
+ --> $DIR/promote-not.rs:68 :29
104
94
|
105
95
LL | let _val: &'static _ = &(1/0);
106
96
| ---------- ^^^^^ creates a temporary value which is freed while still in use
@@ -111,7 +101,7 @@ LL | }
111
101
| - temporary value is freed at the end of this statement
112
102
113
103
error[E0716]: temporary value dropped while borrowed
114
- --> $DIR/promote-not.rs:70 :29
104
+ --> $DIR/promote-not.rs:69 :29
115
105
|
116
106
LL | let _val: &'static _ = &(1/(1-1));
117
107
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -122,7 +112,7 @@ LL | }
122
112
| - temporary value is freed at the end of this statement
123
113
124
114
error[E0716]: temporary value dropped while borrowed
125
- --> $DIR/promote-not.rs:71 :29
115
+ --> $DIR/promote-not.rs:70 :29
126
116
|
127
117
LL | let _val: &'static _ = &((1+1)/(1-1));
128
118
| ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -133,7 +123,7 @@ LL | }
133
123
| - temporary value is freed at the end of this statement
134
124
135
125
error[E0716]: temporary value dropped while borrowed
136
- --> $DIR/promote-not.rs:72 :29
126
+ --> $DIR/promote-not.rs:71 :29
137
127
|
138
128
LL | let _val: &'static _ = &(i32::MIN/-1);
139
129
| ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -144,7 +134,7 @@ LL | }
144
134
| - temporary value is freed at the end of this statement
145
135
146
136
error[E0716]: temporary value dropped while borrowed
147
- --> $DIR/promote-not.rs:73 :29
137
+ --> $DIR/promote-not.rs:72 :29
148
138
|
149
139
LL | let _val: &'static _ = &(i32::MIN/(0-1));
150
140
| ---------- ^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -155,7 +145,7 @@ LL | }
155
145
| - temporary value is freed at the end of this statement
156
146
157
147
error[E0716]: temporary value dropped while borrowed
158
- --> $DIR/promote-not.rs:74 :29
148
+ --> $DIR/promote-not.rs:73 :29
159
149
|
160
150
LL | let _val: &'static _ = &(-128i8/-1);
161
151
| ---------- ^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -166,7 +156,7 @@ LL | }
166
156
| - temporary value is freed at the end of this statement
167
157
168
158
error[E0716]: temporary value dropped while borrowed
169
- --> $DIR/promote-not.rs:75 :29
159
+ --> $DIR/promote-not.rs:74 :29
170
160
|
171
161
LL | let _val: &'static _ = &(1%0);
172
162
| ---------- ^^^^^ creates a temporary value which is freed while still in use
@@ -177,7 +167,7 @@ LL | }
177
167
| - temporary value is freed at the end of this statement
178
168
179
169
error[E0716]: temporary value dropped while borrowed
180
- --> $DIR/promote-not.rs:76 :29
170
+ --> $DIR/promote-not.rs:75 :29
181
171
|
182
172
LL | let _val: &'static _ = &(1%(1-1));
183
173
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -188,7 +178,7 @@ LL | }
188
178
| - temporary value is freed at the end of this statement
189
179
190
180
error[E0716]: temporary value dropped while borrowed
191
- --> $DIR/promote-not.rs:77 :29
181
+ --> $DIR/promote-not.rs:76 :29
192
182
|
193
183
LL | let _val: &'static _ = &([1,2,3][4]+1);
194
184
| ---------- ^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -199,7 +189,7 @@ LL | }
199
189
| - temporary value is freed at the end of this statement
200
190
201
191
error[E0716]: temporary value dropped while borrowed
202
- --> $DIR/promote-not.rs:81 :29
192
+ --> $DIR/promote-not.rs:80 :29
203
193
|
204
194
LL | let _val: &'static _ = &TEST_DROP;
205
195
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -210,7 +200,7 @@ LL | }
210
200
| - temporary value is freed at the end of this statement
211
201
212
202
error[E0716]: temporary value dropped while borrowed
213
- --> $DIR/promote-not.rs:83 :29
203
+ --> $DIR/promote-not.rs:82 :29
214
204
|
215
205
LL | let _val: &'static _ = &&TEST_DROP;
216
206
| ---------- ^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -221,7 +211,7 @@ LL | }
221
211
| - temporary value is freed at the end of this statement
222
212
223
213
error[E0716]: temporary value dropped while borrowed
224
- --> $DIR/promote-not.rs:83 :30
214
+ --> $DIR/promote-not.rs:82 :30
225
215
|
226
216
LL | let _val: &'static _ = &&TEST_DROP;
227
217
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -232,7 +222,7 @@ LL | }
232
222
| - temporary value is freed at the end of this statement
233
223
234
224
error[E0716]: temporary value dropped while borrowed
235
- --> $DIR/promote-not.rs:86 :29
225
+ --> $DIR/promote-not.rs:85 :29
236
226
|
237
227
LL | let _val: &'static _ = &(&TEST_DROP,);
238
228
| ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -243,7 +233,7 @@ LL | }
243
233
| - temporary value is freed at the end of this statement
244
234
245
235
error[E0716]: temporary value dropped while borrowed
246
- --> $DIR/promote-not.rs:86 :31
236
+ --> $DIR/promote-not.rs:85 :31
247
237
|
248
238
LL | let _val: &'static _ = &(&TEST_DROP,);
249
239
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -254,7 +244,7 @@ LL | }
254
244
| - temporary value is freed at the end of this statement
255
245
256
246
error[E0716]: temporary value dropped while borrowed
257
- --> $DIR/promote-not.rs:89 :29
247
+ --> $DIR/promote-not.rs:88 :29
258
248
|
259
249
LL | let _val: &'static _ = &[&TEST_DROP; 1];
260
250
| ---------- ^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -265,7 +255,7 @@ LL | }
265
255
| - temporary value is freed at the end of this statement
266
256
267
257
error[E0716]: temporary value dropped while borrowed
268
- --> $DIR/promote-not.rs:89 :31
258
+ --> $DIR/promote-not.rs:88 :31
269
259
|
270
260
LL | let _val: &'static _ = &[&TEST_DROP; 1];
271
261
| ---------- ^^^^^^^^^ - temporary value is freed at the end of this statement
@@ -274,7 +264,7 @@ LL | let _val: &'static _ = &[&TEST_DROP; 1];
274
264
| type annotation requires that borrow lasts for `'static`
275
265
276
266
error[E0716]: temporary value dropped while borrowed
277
- --> $DIR/promote-not.rs:98 :26
267
+ --> $DIR/promote-not.rs:97 :26
278
268
|
279
269
LL | let x: &'static _ = &UnionWithCell { f1: 0 };
280
270
| ---------- ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
284
274
LL | }
285
275
| - temporary value is freed at the end of this statement
286
276
287
- error: aborting due to 27 previous errors
277
+ error: aborting due to 26 previous errors
288
278
289
279
Some errors have detailed explanations: E0493, E0716.
290
280
For more information about an error, try `rustc --explain E0493`.
0 commit comments