fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
8.4 KiB215 linesraw
1error[E0716]: temporary value dropped while borrowed
2  --> $DIR/promote-not.rs:8:50
3   |
4LL | 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
11error[E0716]: temporary value dropped while borrowed
12  --> $DIR/promote-not.rs:11:18
13   |
14LL |     let x = &mut [1,2,3];
15   |                  ^^^^^^^ creates a temporary value which is freed while still in use
16LL |     x
17   |     - using this value as a static requires that borrow lasts for `'static`
18LL | };
19   | - temporary value is freed at the end of this statement
20
21error[E0716]: temporary value dropped while borrowed
22  --> $DIR/promote-not.rs:20:32
23   |
24LL |         let _x: &'static () = &foo();
25   |                 -----------    ^^^^^ creates a temporary value which is freed while still in use
26   |                 |
27   |                 type annotation requires that borrow lasts for `'static`
28LL |     }
29   |     - temporary value is freed at the end of this statement
30
31error[E0716]: temporary value dropped while borrowed
32  --> $DIR/promote-not.rs:28:29
33   |
34LL |     let _x: &'static i32 = &unsafe { U { x: 0 }.x };
35   |             ------------    ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
36   |             |
37   |             type annotation requires that borrow lasts for `'static`
38LL | }
39   | - temporary value is freed at the end of this statement
40
41error[E0716]: temporary value dropped while borrowed
42  --> $DIR/promote-not.rs:33:29
43   |
44LL |     let _x: &'static i32 = &unsafe { U { x: 0 }.x };
45   |             ------------    ^^^^^^^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
46   |             |
47   |             type annotation requires that borrow lasts for `'static`
48LL | };
49   | - temporary value is freed at the end of this statement
50
51error[E0716]: temporary value dropped while borrowed
52  --> $DIR/promote-not.rs:39:29
53   |
54LL |     let _val: &'static _ = &(Cell::new(1), 2).1;
55   |               ----------    ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
56   |               |
57   |               type annotation requires that borrow lasts for `'static`
58LL | };
59   | - temporary value is freed at the end of this statement
60
61error[E0716]: temporary value dropped while borrowed
62  --> $DIR/promote-not.rs:46:29
63   |
64LL |     let _val: &'static _ = &(Cell::new(1), 2).0;
65   |               ----------    ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
66   |               |
67   |               type annotation requires that borrow lasts for `'static`
68...
69LL | }
70   | - temporary value is freed at the end of this statement
71
72error[E0716]: temporary value dropped while borrowed
73  --> $DIR/promote-not.rs:47:29
74   |
75LL |     let _val: &'static _ = &(Cell::new(1), 2).1;
76   |               ----------    ^^^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
77   |               |
78   |               type annotation requires that borrow lasts for `'static`
79...
80LL | }
81   | - temporary value is freed at the end of this statement
82
83error[E0716]: temporary value dropped while borrowed
84  --> $DIR/promote-not.rs:50:29
85   |
86LL |     let _val: &'static _ = &(1/0);
87   |               ----------    ^^^^^ creates a temporary value which is freed while still in use
88   |               |
89   |               type annotation requires that borrow lasts for `'static`
90...
91LL | }
92   | - temporary value is freed at the end of this statement
93
94error[E0716]: temporary value dropped while borrowed
95  --> $DIR/promote-not.rs:51:29
96   |
97LL |     let _val: &'static _ = &(1/(1-1));
98   |               ----------    ^^^^^^^^^ creates a temporary value which is freed while still in use
99   |               |
100   |               type annotation requires that borrow lasts for `'static`
101...
102LL | }
103   | - temporary value is freed at the end of this statement
104
105error[E0716]: temporary value dropped while borrowed
106  --> $DIR/promote-not.rs:52:29
107   |
108LL |     let _val: &'static _ = &(1%0);
109   |               ----------    ^^^^^ creates a temporary value which is freed while still in use
110   |               |
111   |               type annotation requires that borrow lasts for `'static`
112...
113LL | }
114   | - temporary value is freed at the end of this statement
115
116error[E0716]: temporary value dropped while borrowed
117  --> $DIR/promote-not.rs:53:29
118   |
119LL |     let _val: &'static _ = &(1%(1-1));
120   |               ----------    ^^^^^^^^^ creates a temporary value which is freed while still in use
121   |               |
122   |               type annotation requires that borrow lasts for `'static`
123...
124LL | }
125   | - temporary value is freed at the end of this statement
126
127error[E0716]: temporary value dropped while borrowed
128  --> $DIR/promote-not.rs:54:29
129   |
130LL |     let _val: &'static _ = &([1,2,3][4]+1);
131   |               ----------    ^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
132   |               |
133   |               type annotation requires that borrow lasts for `'static`
134...
135LL | }
136   | - temporary value is freed at the end of this statement
137
138error[E0716]: temporary value dropped while borrowed
139  --> $DIR/promote-not.rs:57:29
140   |
141LL |     let _val: &'static _ = &TEST_DROP;
142   |               ----------    ^^^^^^^^^ creates a temporary value which is freed while still in use
143   |               |
144   |               type annotation requires that borrow lasts for `'static`
145...
146LL | }
147   | - temporary value is freed at the end of this statement
148
149error[E0716]: temporary value dropped while borrowed
150  --> $DIR/promote-not.rs:59:29
151   |
152LL |     let _val: &'static _ = &&TEST_DROP;
153   |               ----------    ^^^^^^^^^^ creates a temporary value which is freed while still in use
154   |               |
155   |               type annotation requires that borrow lasts for `'static`
156...
157LL | }
158   | - temporary value is freed at the end of this statement
159
160error[E0716]: temporary value dropped while borrowed
161  --> $DIR/promote-not.rs:59:30
162   |
163LL |     let _val: &'static _ = &&TEST_DROP;
164   |               ----------     ^^^^^^^^^ creates a temporary value which is freed while still in use
165   |               |
166   |               type annotation requires that borrow lasts for `'static`
167...
168LL | }
169   | - temporary value is freed at the end of this statement
170
171error[E0716]: temporary value dropped while borrowed
172  --> $DIR/promote-not.rs:62:29
173   |
174LL |     let _val: &'static _ = &(&TEST_DROP,);
175   |               ----------    ^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
176   |               |
177   |               type annotation requires that borrow lasts for `'static`
178...
179LL | }
180   | - temporary value is freed at the end of this statement
181
182error[E0716]: temporary value dropped while borrowed
183  --> $DIR/promote-not.rs:62:31
184   |
185LL |     let _val: &'static _ = &(&TEST_DROP,);
186   |               ----------      ^^^^^^^^^ creates a temporary value which is freed while still in use
187   |               |
188   |               type annotation requires that borrow lasts for `'static`
189...
190LL | }
191   | - temporary value is freed at the end of this statement
192
193error[E0716]: temporary value dropped while borrowed
194  --> $DIR/promote-not.rs:65:29
195   |
196LL |     let _val: &'static _ = &[&TEST_DROP; 1];
197   |               ----------    ^^^^^^^^^^^^^^^ creates a temporary value which is freed while still in use
198   |               |
199   |               type annotation requires that borrow lasts for `'static`
200...
201LL | }
202   | - temporary value is freed at the end of this statement
203
204error[E0716]: temporary value dropped while borrowed
205  --> $DIR/promote-not.rs:65:31
206   |
207LL |     let _val: &'static _ = &[&TEST_DROP; 1];
208   |               ----------      ^^^^^^^^^    - temporary value is freed at the end of this statement
209   |               |               |
210   |               |               creates a temporary value which is freed while still in use
211   |               type annotation requires that borrow lasts for `'static`
212
213error: aborting due to 20 previous errors
214
215For more information about this error, try `rustc --explain E0716`.