11error[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
133 |
144LL | let x = &mut [1,2,3];
155 | ^^^^^^^ creates a temporary value which is freed while still in use
199 | - temporary value is freed at the end of this statement
2010
2111error[E0716]: temporary value dropped while borrowed
22- --> $DIR/promote-not.rs:34 :29
12+ --> $DIR/promote-not.rs:33 :29
2313 |
2414LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
2515 | ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -29,7 +19,7 @@ LL | };
2919 | - temporary value is freed at the end of this statement
3020
3121error[E0716]: temporary value dropped while borrowed
32- --> $DIR/promote-not.rs:40 :29
22+ --> $DIR/promote-not.rs:39 :29
3323 |
3424LL | let _val: &'static _ = &(Cell::new(1), 2).1;
3525 | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -39,7 +29,7 @@ LL | };
3929 | - temporary value is freed at the end of this statement
4030
4131error[E0493]: destructor of `String` cannot be evaluated at compile-time
42- --> $DIR/promote-not.rs:47 :14
32+ --> $DIR/promote-not.rs:46 :14
4333 |
4434LL | let x = &String::new();
4535 | ^^^^^^^^^^^^^ the destructor for this type cannot be evaluated in constants
@@ -48,7 +38,7 @@ LL | };
4838 | - value is dropped here
4939
5040error[E0716]: temporary value dropped while borrowed
51- --> $DIR/promote-not.rs:59 :33
41+ --> $DIR/promote-not.rs:58 :33
5242 |
5343LL | let _x: &'static u32 = &mk_panic();
5444 | ------------ ^^^^^^^^^^ creates a temporary value which is freed while still in use
5848 | - temporary value is freed at the end of this statement
5949
6050error[E0716]: temporary value dropped while borrowed
61- --> $DIR/promote-not.rs:21 :32
51+ --> $DIR/promote-not.rs:20 :32
6252 |
6353LL | let _x: &'static () = &foo();
6454 | ----------- ^^^^^ creates a temporary value which is freed while still in use
6858 | - temporary value is freed at the end of this statement
6959
7060error[E0716]: temporary value dropped while borrowed
71- --> $DIR/promote-not.rs:29 :29
61+ --> $DIR/promote-not.rs:28 :29
7262 |
7363LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
7464 | ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
7868 | - temporary value is freed at the end of this statement
7969
8070error[E0716]: temporary value dropped while borrowed
81- --> $DIR/promote-not.rs:65 :29
71+ --> $DIR/promote-not.rs:64 :29
8272 |
8373LL | let _val: &'static _ = &(Cell::new(1), 2).0;
8474 | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
8979 | - temporary value is freed at the end of this statement
9080
9181error[E0716]: temporary value dropped while borrowed
92- --> $DIR/promote-not.rs:66 :29
82+ --> $DIR/promote-not.rs:65 :29
9383 |
9484LL | let _val: &'static _ = &(Cell::new(1), 2).1;
9585 | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -100,7 +90,7 @@ LL | }
10090 | - temporary value is freed at the end of this statement
10191
10292error[E0716]: temporary value dropped while borrowed
103- --> $DIR/promote-not.rs:69 :29
93+ --> $DIR/promote-not.rs:68 :29
10494 |
10595LL | let _val: &'static _ = &(1/0);
10696 | ---------- ^^^^^ creates a temporary value which is freed while still in use
@@ -111,7 +101,7 @@ LL | }
111101 | - temporary value is freed at the end of this statement
112102
113103error[E0716]: temporary value dropped while borrowed
114- --> $DIR/promote-not.rs:70 :29
104+ --> $DIR/promote-not.rs:69 :29
115105 |
116106LL | let _val: &'static _ = &(1/(1-1));
117107 | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -122,7 +112,7 @@ LL | }
122112 | - temporary value is freed at the end of this statement
123113
124114error[E0716]: temporary value dropped while borrowed
125- --> $DIR/promote-not.rs:71 :29
115+ --> $DIR/promote-not.rs:70 :29
126116 |
127117LL | let _val: &'static _ = &((1+1)/(1-1));
128118 | ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -133,7 +123,7 @@ LL | }
133123 | - temporary value is freed at the end of this statement
134124
135125error[E0716]: temporary value dropped while borrowed
136- --> $DIR/promote-not.rs:72 :29
126+ --> $DIR/promote-not.rs:71 :29
137127 |
138128LL | let _val: &'static _ = &(i32::MIN/-1);
139129 | ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -144,7 +134,7 @@ LL | }
144134 | - temporary value is freed at the end of this statement
145135
146136error[E0716]: temporary value dropped while borrowed
147- --> $DIR/promote-not.rs:73 :29
137+ --> $DIR/promote-not.rs:72 :29
148138 |
149139LL | let _val: &'static _ = &(i32::MIN/(0-1));
150140 | ---------- ^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -155,7 +145,7 @@ LL | }
155145 | - temporary value is freed at the end of this statement
156146
157147error[E0716]: temporary value dropped while borrowed
158- --> $DIR/promote-not.rs:74 :29
148+ --> $DIR/promote-not.rs:73 :29
159149 |
160150LL | let _val: &'static _ = &(-128i8/-1);
161151 | ---------- ^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -166,7 +156,7 @@ LL | }
166156 | - temporary value is freed at the end of this statement
167157
168158error[E0716]: temporary value dropped while borrowed
169- --> $DIR/promote-not.rs:75 :29
159+ --> $DIR/promote-not.rs:74 :29
170160 |
171161LL | let _val: &'static _ = &(1%0);
172162 | ---------- ^^^^^ creates a temporary value which is freed while still in use
@@ -177,7 +167,7 @@ LL | }
177167 | - temporary value is freed at the end of this statement
178168
179169error[E0716]: temporary value dropped while borrowed
180- --> $DIR/promote-not.rs:76 :29
170+ --> $DIR/promote-not.rs:75 :29
181171 |
182172LL | let _val: &'static _ = &(1%(1-1));
183173 | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -188,7 +178,7 @@ LL | }
188178 | - temporary value is freed at the end of this statement
189179
190180error[E0716]: temporary value dropped while borrowed
191- --> $DIR/promote-not.rs:77 :29
181+ --> $DIR/promote-not.rs:76 :29
192182 |
193183LL | let _val: &'static _ = &([1,2,3][4]+1);
194184 | ---------- ^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -199,7 +189,7 @@ LL | }
199189 | - temporary value is freed at the end of this statement
200190
201191error[E0716]: temporary value dropped while borrowed
202- --> $DIR/promote-not.rs:81 :29
192+ --> $DIR/promote-not.rs:80 :29
203193 |
204194LL | let _val: &'static _ = &TEST_DROP;
205195 | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -210,7 +200,7 @@ LL | }
210200 | - temporary value is freed at the end of this statement
211201
212202error[E0716]: temporary value dropped while borrowed
213- --> $DIR/promote-not.rs:83 :29
203+ --> $DIR/promote-not.rs:82 :29
214204 |
215205LL | let _val: &'static _ = &&TEST_DROP;
216206 | ---------- ^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -221,7 +211,7 @@ LL | }
221211 | - temporary value is freed at the end of this statement
222212
223213error[E0716]: temporary value dropped while borrowed
224- --> $DIR/promote-not.rs:83 :30
214+ --> $DIR/promote-not.rs:82 :30
225215 |
226216LL | let _val: &'static _ = &&TEST_DROP;
227217 | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -232,7 +222,7 @@ LL | }
232222 | - temporary value is freed at the end of this statement
233223
234224error[E0716]: temporary value dropped while borrowed
235- --> $DIR/promote-not.rs:86 :29
225+ --> $DIR/promote-not.rs:85 :29
236226 |
237227LL | let _val: &'static _ = &(&TEST_DROP,);
238228 | ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -243,7 +233,7 @@ LL | }
243233 | - temporary value is freed at the end of this statement
244234
245235error[E0716]: temporary value dropped while borrowed
246- --> $DIR/promote-not.rs:86 :31
236+ --> $DIR/promote-not.rs:85 :31
247237 |
248238LL | let _val: &'static _ = &(&TEST_DROP,);
249239 | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -254,7 +244,7 @@ LL | }
254244 | - temporary value is freed at the end of this statement
255245
256246error[E0716]: temporary value dropped while borrowed
257- --> $DIR/promote-not.rs:89 :29
247+ --> $DIR/promote-not.rs:88 :29
258248 |
259249LL | let _val: &'static _ = &[&TEST_DROP; 1];
260250 | ---------- ^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -265,7 +255,7 @@ LL | }
265255 | - temporary value is freed at the end of this statement
266256
267257error[E0716]: temporary value dropped while borrowed
268- --> $DIR/promote-not.rs:89 :31
258+ --> $DIR/promote-not.rs:88 :31
269259 |
270260LL | let _val: &'static _ = &[&TEST_DROP; 1];
271261 | ---------- ^^^^^^^^^ - temporary value is freed at the end of this statement
@@ -274,7 +264,7 @@ LL | let _val: &'static _ = &[&TEST_DROP; 1];
274264 | type annotation requires that borrow lasts for `'static`
275265
276266error[E0716]: temporary value dropped while borrowed
277- --> $DIR/promote-not.rs:98 :26
267+ --> $DIR/promote-not.rs:97 :26
278268 |
279269LL | let x: &'static _ = &UnionWithCell { f1: 0 };
280270 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
284274LL | }
285275 | - temporary value is freed at the end of this statement
286276
287- error: aborting due to 27 previous errors
277+ error: aborting due to 26 previous errors
288278
289279Some errors have detailed explanations: E0493, E0716.
290280For more information about an error, try `rustc --explain E0493`.
0 commit comments