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