11error[E0716]: temporary value dropped while borrowed
2- --> $DIR/promote-not.rs:9:50
2+ --> $DIR/promote-not.rs:10:46
33 |
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`
1010
1111error[E0716]: temporary value dropped while borrowed
12- --> $DIR/promote-not.rs:12 :18
12+ --> $DIR/promote-not.rs:13 :18
1313 |
1414LL | let x = &mut [1,2,3];
1515 | ^^^^^^^ creates a temporary value which is freed while still in use
@@ -19,7 +19,7 @@ LL | };
1919 | - temporary value is freed at the end of this statement
2020
2121error[E0716]: temporary value dropped while borrowed
22- --> $DIR/promote-not.rs:34 :29
22+ --> $DIR/promote-not.rs:35 :29
2323 |
2424LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
2525 | ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -29,7 +29,7 @@ LL | };
2929 | - temporary value is freed at the end of this statement
3030
3131error[E0716]: temporary value dropped while borrowed
32- --> $DIR/promote-not.rs:40 :29
32+ --> $DIR/promote-not.rs:41 :29
3333 |
3434LL | let _val: &'static _ = &(Cell::new(1), 2).1;
3535 | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -39,7 +39,7 @@ LL | };
3939 | - temporary value is freed at the end of this statement
4040
4141error[E0493]: destructor of `String` cannot be evaluated at compile-time
42- --> $DIR/promote-not.rs:47 :14
42+ --> $DIR/promote-not.rs:48 :14
4343 |
4444LL | let x = &String::new();
4545 | ^^^^^^^^^^^^^ the destructor for this type cannot be evaluated in constants
@@ -48,7 +48,7 @@ LL | };
4848 | - value is dropped here
4949
5050error[E0716]: temporary value dropped while borrowed
51- --> $DIR/promote-not.rs:59 :33
51+ --> $DIR/promote-not.rs:60 :33
5252 |
5353LL | let _x: &'static u32 = &mk_panic();
5454 | ------------ ^^^^^^^^^^ creates a temporary value which is freed while still in use
5858 | - temporary value is freed at the end of this statement
5959
6060error[E0716]: temporary value dropped while borrowed
61- --> $DIR/promote-not.rs:21 :32
61+ --> $DIR/promote-not.rs:22 :32
6262 |
6363LL | let _x: &'static () = &foo();
6464 | ----------- ^^^^^ creates a temporary value which is freed while still in use
6868 | - temporary value is freed at the end of this statement
6969
7070error[E0716]: temporary value dropped while borrowed
71- --> $DIR/promote-not.rs:29 :29
71+ --> $DIR/promote-not.rs:30 :29
7272 |
7373LL | let _x: &'static i32 = &unsafe { U { x: 0 }.x };
7474 | ------------ ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
7878 | - temporary value is freed at the end of this statement
7979
8080error[E0716]: temporary value dropped while borrowed
81- --> $DIR/promote-not.rs:65 :29
81+ --> $DIR/promote-not.rs:66 :29
8282 |
8383LL | let _val: &'static _ = &(Cell::new(1), 2).0;
8484 | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
8989 | - temporary value is freed at the end of this statement
9090
9191error[E0716]: temporary value dropped while borrowed
92- --> $DIR/promote-not.rs:66 :29
92+ --> $DIR/promote-not.rs:67 :29
9393 |
9494LL | let _val: &'static _ = &(Cell::new(1), 2).1;
9595 | ---------- ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -100,7 +100,7 @@ LL | }
100100 | - temporary value is freed at the end of this statement
101101
102102error[E0716]: temporary value dropped while borrowed
103- --> $DIR/promote-not.rs:69 :29
103+ --> $DIR/promote-not.rs:70 :29
104104 |
105105LL | let _val: &'static _ = &(1/0);
106106 | ---------- ^^^^^ creates a temporary value which is freed while still in use
@@ -111,7 +111,7 @@ LL | }
111111 | - temporary value is freed at the end of this statement
112112
113113error[E0716]: temporary value dropped while borrowed
114- --> $DIR/promote-not.rs:70 :29
114+ --> $DIR/promote-not.rs:71 :29
115115 |
116116LL | let _val: &'static _ = &(1/(1-1));
117117 | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -122,7 +122,7 @@ LL | }
122122 | - temporary value is freed at the end of this statement
123123
124124error[E0716]: temporary value dropped while borrowed
125- --> $DIR/promote-not.rs:71 :29
125+ --> $DIR/promote-not.rs:72 :29
126126 |
127127LL | let _val: &'static _ = &((1+1)/(1-1));
128128 | ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -133,7 +133,7 @@ LL | }
133133 | - temporary value is freed at the end of this statement
134134
135135error[E0716]: temporary value dropped while borrowed
136- --> $DIR/promote-not.rs:72 :29
136+ --> $DIR/promote-not.rs:73 :29
137137 |
138138LL | let _val: &'static _ = &(i32::MIN/-1);
139139 | ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -144,7 +144,7 @@ LL | }
144144 | - temporary value is freed at the end of this statement
145145
146146error[E0716]: temporary value dropped while borrowed
147- --> $DIR/promote-not.rs:73 :29
147+ --> $DIR/promote-not.rs:74 :29
148148 |
149149LL | let _val: &'static _ = &(i32::MIN/(0-1));
150150 | ---------- ^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -155,7 +155,7 @@ LL | }
155155 | - temporary value is freed at the end of this statement
156156
157157error[E0716]: temporary value dropped while borrowed
158- --> $DIR/promote-not.rs:74 :29
158+ --> $DIR/promote-not.rs:75 :29
159159 |
160160LL | let _val: &'static _ = &(-128i8/-1);
161161 | ---------- ^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -166,7 +166,7 @@ LL | }
166166 | - temporary value is freed at the end of this statement
167167
168168error[E0716]: temporary value dropped while borrowed
169- --> $DIR/promote-not.rs:75 :29
169+ --> $DIR/promote-not.rs:76 :29
170170 |
171171LL | let _val: &'static _ = &(1%0);
172172 | ---------- ^^^^^ creates a temporary value which is freed while still in use
@@ -177,7 +177,7 @@ LL | }
177177 | - temporary value is freed at the end of this statement
178178
179179error[E0716]: temporary value dropped while borrowed
180- --> $DIR/promote-not.rs:76 :29
180+ --> $DIR/promote-not.rs:77 :29
181181 |
182182LL | let _val: &'static _ = &(1%(1-1));
183183 | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -188,7 +188,7 @@ LL | }
188188 | - temporary value is freed at the end of this statement
189189
190190error[E0716]: temporary value dropped while borrowed
191- --> $DIR/promote-not.rs:77 :29
191+ --> $DIR/promote-not.rs:78 :29
192192 |
193193LL | let _val: &'static _ = &([1,2,3][4]+1);
194194 | ---------- ^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -199,7 +199,7 @@ LL | }
199199 | - temporary value is freed at the end of this statement
200200
201201error[E0716]: temporary value dropped while borrowed
202- --> $DIR/promote-not.rs:81 :29
202+ --> $DIR/promote-not.rs:82 :29
203203 |
204204LL | let _val: &'static _ = &TEST_DROP;
205205 | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -210,7 +210,7 @@ LL | }
210210 | - temporary value is freed at the end of this statement
211211
212212error[E0716]: temporary value dropped while borrowed
213- --> $DIR/promote-not.rs:83 :29
213+ --> $DIR/promote-not.rs:84 :29
214214 |
215215LL | let _val: &'static _ = &&TEST_DROP;
216216 | ---------- ^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -221,7 +221,7 @@ LL | }
221221 | - temporary value is freed at the end of this statement
222222
223223error[E0716]: temporary value dropped while borrowed
224- --> $DIR/promote-not.rs:83 :30
224+ --> $DIR/promote-not.rs:84 :30
225225 |
226226LL | let _val: &'static _ = &&TEST_DROP;
227227 | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -232,7 +232,7 @@ LL | }
232232 | - temporary value is freed at the end of this statement
233233
234234error[E0716]: temporary value dropped while borrowed
235- --> $DIR/promote-not.rs:86 :29
235+ --> $DIR/promote-not.rs:87 :29
236236 |
237237LL | let _val: &'static _ = &(&TEST_DROP,);
238238 | ---------- ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -243,7 +243,7 @@ LL | }
243243 | - temporary value is freed at the end of this statement
244244
245245error[E0716]: temporary value dropped while borrowed
246- --> $DIR/promote-not.rs:86 :31
246+ --> $DIR/promote-not.rs:87 :31
247247 |
248248LL | let _val: &'static _ = &(&TEST_DROP,);
249249 | ---------- ^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -254,7 +254,7 @@ LL | }
254254 | - temporary value is freed at the end of this statement
255255
256256error[E0716]: temporary value dropped while borrowed
257- --> $DIR/promote-not.rs:89 :29
257+ --> $DIR/promote-not.rs:90 :29
258258 |
259259LL | let _val: &'static _ = &[&TEST_DROP; 1];
260260 | ---------- ^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
@@ -265,7 +265,7 @@ LL | }
265265 | - temporary value is freed at the end of this statement
266266
267267error[E0716]: temporary value dropped while borrowed
268- --> $DIR/promote-not.rs:89 :31
268+ --> $DIR/promote-not.rs:90 :31
269269 |
270270LL | let _val: &'static _ = &[&TEST_DROP; 1];
271271 | ---------- ^^^^^^^^^ - temporary value is freed at the end of this statement
@@ -274,7 +274,7 @@ LL | let _val: &'static _ = &[&TEST_DROP; 1];
274274 | type annotation requires that borrow lasts for `'static`
275275
276276error[E0716]: temporary value dropped while borrowed
277- --> $DIR/promote-not.rs:98 :26
277+ --> $DIR/promote-not.rs:99 :26
278278 |
279279LL | let x: &'static _ = &UnionWithCell { f1: 0 };
280280 | ---------- ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
0 commit comments