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
@@ -38,8 +38,17 @@ LL | let _val: &'static _ = &(Cell::new(1), 2).1;
38
38
LL | };
39
39
| - temporary value is freed at the end of this statement
40
40
41
+ error[E0493]: destructor of `String` cannot be evaluated at compile-time
42
+ --> $DIR/promote-not.rs:47:14
43
+ |
44
+ LL | let x = &String::new();
45
+ | ^^^^^^^^^^^^^ the destructor for this type cannot be evaluated in constants
46
+ ...
47
+ LL | };
48
+ | - value is dropped here
49
+
41
50
error[E0716]: temporary value dropped while borrowed
42
- --> $DIR/promote-not.rs:20 :32
51
+ --> $DIR/promote-not.rs:21 :32
43
52
|
44
53
LL | let _x: &'static () = &foo();
45
54
| ----------- ^^^^^ creates a temporary value which is freed while still in use
49
58
| - temporary value is freed at the end of this statement
50
59
51
60
error[E0716]: temporary value dropped while borrowed
52
- --> $DIR/promote-not.rs:28 :29
61
+ --> $DIR/promote-not.rs:29 :29
53
62
|
54
63
LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
55
64
| ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
59
68
| - temporary value is freed at the end of this statement
60
69
61
70
error[E0716]: temporary value dropped while borrowed
62
- --> $DIR/promote-not.rs:46 :29
71
+ --> $DIR/promote-not.rs:56 :29
63
72
|
64
73
LL | let _val: &'static _ = &(Cell::new(1), 2).0;
65
74
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
70
79
| - temporary value is freed at the end of this statement
71
80
72
81
error[E0716]: temporary value dropped while borrowed
73
- --> $DIR/promote-not.rs:47 :29
82
+ --> $DIR/promote-not.rs:57 :29
74
83
|
75
84
LL | let _val: &'static _ = &(Cell::new(1), 2).1;
76
85
| ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
81
90
| - temporary value is freed at the end of this statement
82
91
83
92
error[E0716]: temporary value dropped while borrowed
84
- --> $DIR/promote-not.rs:50 :29
93
+ --> $DIR/promote-not.rs:60 :29
85
94
|
86
95
LL | let _val: &'static _ = &(1/0);
87
96
| ---------- ^^^^^ creates a temporary value which is freed while still in use
@@ -92,7 +101,7 @@ LL | }
92
101
| - temporary value is freed at the end of this statement
93
102
94
103
error[E0716]: temporary value dropped while borrowed
95
- --> $DIR/promote-not.rs:51 :29
104
+ --> $DIR/promote-not.rs:61 :29
96
105
|
97
106
LL | let _val: &'static _ = &(1/(1-1));
98
107
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -103,7 +112,7 @@ LL | }
103
112
| - temporary value is freed at the end of this statement
104
113
105
114
error[E0716]: temporary value dropped while borrowed
106
- --> $DIR/promote-not.rs:52 :29
115
+ --> $DIR/promote-not.rs:62 :29
107
116
|
108
117
LL | let _val: &'static _ = &((1+1)/(1-1));
109
118
| ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -114,7 +123,7 @@ LL | }
114
123
| - temporary value is freed at the end of this statement
115
124
116
125
error[E0716]: temporary value dropped while borrowed
117
- --> $DIR/promote-not.rs:53 :29
126
+ --> $DIR/promote-not.rs:63 :29
118
127
|
119
128
LL | let _val: &'static _ = &(i32::MIN/-1);
120
129
| ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -125,7 +134,7 @@ LL | }
125
134
| - temporary value is freed at the end of this statement
126
135
127
136
error[E0716]: temporary value dropped while borrowed
128
- --> $DIR/promote-not.rs:54 :29
137
+ --> $DIR/promote-not.rs:64 :29
129
138
|
130
139
LL | let _val: &'static _ = &(i32::MIN/(0-1));
131
140
| ---------- ^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -136,7 +145,7 @@ LL | }
136
145
| - temporary value is freed at the end of this statement
137
146
138
147
error[E0716]: temporary value dropped while borrowed
139
- --> $DIR/promote-not.rs:55 :29
148
+ --> $DIR/promote-not.rs:65 :29
140
149
|
141
150
LL | let _val: &'static _ = &(-128i8/-1);
142
151
| ---------- ^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -147,7 +156,7 @@ LL | }
147
156
| - temporary value is freed at the end of this statement
148
157
149
158
error[E0716]: temporary value dropped while borrowed
150
- --> $DIR/promote-not.rs:56 :29
159
+ --> $DIR/promote-not.rs:66 :29
151
160
|
152
161
LL | let _val: &'static _ = &(1%0);
153
162
| ---------- ^^^^^ creates a temporary value which is freed while still in use
@@ -158,7 +167,7 @@ LL | }
158
167
| - temporary value is freed at the end of this statement
159
168
160
169
error[E0716]: temporary value dropped while borrowed
161
- --> $DIR/promote-not.rs:57 :29
170
+ --> $DIR/promote-not.rs:67 :29
162
171
|
163
172
LL | let _val: &'static _ = &(1%(1-1));
164
173
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -169,7 +178,7 @@ LL | }
169
178
| - temporary value is freed at the end of this statement
170
179
171
180
error[E0716]: temporary value dropped while borrowed
172
- --> $DIR/promote-not.rs:58 :29
181
+ --> $DIR/promote-not.rs:68 :29
173
182
|
174
183
LL | let _val: &'static _ = &([1,2,3][4]+1);
175
184
| ---------- ^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -180,7 +189,7 @@ LL | }
180
189
| - temporary value is freed at the end of this statement
181
190
182
191
error[E0716]: temporary value dropped while borrowed
183
- --> $DIR/promote-not.rs:61 :29
192
+ --> $DIR/promote-not.rs:72 :29
184
193
|
185
194
LL | let _val: &'static _ = &TEST_DROP;
186
195
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -191,7 +200,7 @@ LL | }
191
200
| - temporary value is freed at the end of this statement
192
201
193
202
error[E0716]: temporary value dropped while borrowed
194
- --> $DIR/promote-not.rs:63 :29
203
+ --> $DIR/promote-not.rs:74 :29
195
204
|
196
205
LL | let _val: &'static _ = &&TEST_DROP;
197
206
| ---------- ^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -202,7 +211,7 @@ LL | }
202
211
| - temporary value is freed at the end of this statement
203
212
204
213
error[E0716]: temporary value dropped while borrowed
205
- --> $DIR/promote-not.rs:63 :30
214
+ --> $DIR/promote-not.rs:74 :30
206
215
|
207
216
LL | let _val: &'static _ = &&TEST_DROP;
208
217
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -213,7 +222,7 @@ LL | }
213
222
| - temporary value is freed at the end of this statement
214
223
215
224
error[E0716]: temporary value dropped while borrowed
216
- --> $DIR/promote-not.rs:66 :29
225
+ --> $DIR/promote-not.rs:77 :29
217
226
|
218
227
LL | let _val: &'static _ = &(&TEST_DROP,);
219
228
| ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -224,7 +233,7 @@ LL | }
224
233
| - temporary value is freed at the end of this statement
225
234
226
235
error[E0716]: temporary value dropped while borrowed
227
- --> $DIR/promote-not.rs:66 :31
236
+ --> $DIR/promote-not.rs:77 :31
228
237
|
229
238
LL | let _val: &'static _ = &(&TEST_DROP,);
230
239
| ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -235,7 +244,7 @@ LL | }
235
244
| - temporary value is freed at the end of this statement
236
245
237
246
error[E0716]: temporary value dropped while borrowed
238
- --> $DIR/promote-not.rs:69 :29
247
+ --> $DIR/promote-not.rs:80 :29
239
248
|
240
249
LL | let _val: &'static _ = &[&TEST_DROP; 1];
241
250
| ---------- ^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -246,14 +255,26 @@ LL | }
246
255
| - temporary value is freed at the end of this statement
247
256
248
257
error[E0716]: temporary value dropped while borrowed
249
- --> $DIR/promote-not.rs:69 :31
258
+ --> $DIR/promote-not.rs:80 :31
250
259
|
251
260
LL | let _val: &'static _ = &[&TEST_DROP; 1];
252
261
| ---------- ^^^^^^^^^ - temporary value is freed at the end of this statement
253
262
| | |
254
263
| | creates a temporary value which is freed while still in use
255
264
| type annotation requires that borrow lasts for `'static`
256
265
257
- error: aborting due to 24 previous errors
266
+ error[E0716]: temporary value dropped while borrowed
267
+ --> $DIR/promote-not.rs:89:26
268
+ |
269
+ LL | let x: &'static _ = &UnionWithCell { f1: 0 };
270
+ | ---------- ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
271
+ | |
272
+ | type annotation requires that borrow lasts for `'static`
273
+ LL |
274
+ LL | }
275
+ | - temporary value is freed at the end of this statement
276
+
277
+ error: aborting due to 26 previous errors
258
278
259
- For more information about this error, try `rustc --explain E0716`.
279
+ Some errors have detailed explanations: E0493, E0716.
280
+ For more information about an error, try `rustc --explain E0493`.
0 commit comments