]> git.lizzy.rs Git - rust.git/blob - src/test/ui/consts/min_const_fn/min_const_fn.stderr
Rollup merge of #93613 - crlf0710:rename_to_async_iter, r=yaahc
[rust.git] / src / test / ui / consts / min_const_fn / min_const_fn.stderr
1 error[E0493]: destructors cannot be evaluated at compile-time
2   --> $DIR/min_const_fn.rs:37:25
3    |
4 LL |     const fn into_inner(self) -> T { self.0 }
5    |                         ^^^^                - value is dropped here
6    |                         |
7    |                         constant functions cannot evaluate destructors
8
9 error[E0658]: mutable references are not allowed in constant functions
10   --> $DIR/min_const_fn.rs:39:22
11    |
12 LL |     const fn get_mut(&mut self) -> &mut T { &mut self.0 }
13    |                      ^^^^^^^^^
14    |
15    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
16    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
17
18 error[E0658]: mutable references are not allowed in constant functions
19   --> $DIR/min_const_fn.rs:39:36
20    |
21 LL |     const fn get_mut(&mut self) -> &mut T { &mut self.0 }
22    |                                    ^^^^^^
23    |
24    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
25    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
26
27 error[E0658]: mutable references are not allowed in constant functions
28   --> $DIR/min_const_fn.rs:39:45
29    |
30 LL |     const fn get_mut(&mut self) -> &mut T { &mut self.0 }
31    |                                             ^^^^^^^^^^^
32    |
33    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
34    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
35
36 error[E0493]: destructors cannot be evaluated at compile-time
37   --> $DIR/min_const_fn.rs:46:28
38    |
39 LL |     const fn into_inner_lt(self) -> T { self.0 }
40    |                            ^^^^                - value is dropped here
41    |                            |
42    |                            constant functions cannot evaluate destructors
43
44 error[E0658]: mutable references are not allowed in constant functions
45   --> $DIR/min_const_fn.rs:48:25
46    |
47 LL |     const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
48    |                         ^^^^^^^^^^^^
49    |
50    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
51    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
52
53 error[E0658]: mutable references are not allowed in constant functions
54   --> $DIR/min_const_fn.rs:48:42
55    |
56 LL |     const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
57    |                                          ^^^^^^
58    |
59    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
60    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
61
62 error[E0658]: mutable references are not allowed in constant functions
63   --> $DIR/min_const_fn.rs:48:51
64    |
65 LL |     const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
66    |                                                   ^^^^^^^^^^^
67    |
68    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
69    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
70
71 error[E0493]: destructors cannot be evaluated at compile-time
72   --> $DIR/min_const_fn.rs:55:27
73    |
74 LL |     const fn into_inner_s(self) -> T { self.0 }
75    |                           ^^^^                - value is dropped here
76    |                           |
77    |                           constant functions cannot evaluate destructors
78
79 error[E0658]: mutable references are not allowed in constant functions
80   --> $DIR/min_const_fn.rs:57:24
81    |
82 LL |     const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
83    |                        ^^^^^^^^^
84    |
85    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
86    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
87
88 error[E0658]: mutable references are not allowed in constant functions
89   --> $DIR/min_const_fn.rs:57:38
90    |
91 LL |     const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
92    |                                      ^^^^^^
93    |
94    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
95    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
96
97 error[E0658]: mutable references are not allowed in constant functions
98   --> $DIR/min_const_fn.rs:57:47
99    |
100 LL |     const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
101    |                                               ^^^^^^^^^^^
102    |
103    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
104    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
105
106 error[E0658]: mutable references are not allowed in constant functions
107   --> $DIR/min_const_fn.rs:64:25
108    |
109 LL |     const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
110    |                         ^^^^^^^^^
111    |
112    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
113    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
114
115 error[E0658]: mutable references are not allowed in constant functions
116   --> $DIR/min_const_fn.rs:64:39
117    |
118 LL |     const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
119    |                                       ^^^^^^
120    |
121    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
122    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
123
124 error[E0658]: mutable references are not allowed in constant functions
125   --> $DIR/min_const_fn.rs:64:48
126    |
127 LL |     const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
128    |                                                ^^^^^^^^^^^
129    |
130    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
131    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
132
133 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
134   --> $DIR/min_const_fn.rs:84:16
135    |
136 LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
137    |                ^
138    |
139    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
140    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
141
142 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
143   --> $DIR/min_const_fn.rs:86:18
144    |
145 LL | const fn foo11_2<T: Send>(t: T) -> T { t }
146    |                  ^
147    |
148    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
149    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
150
151 error[E0013]: constant functions cannot refer to statics
152   --> $DIR/min_const_fn.rs:90:27
153    |
154 LL | const fn foo25() -> u32 { BAR }
155    |                           ^^^
156    |
157    = help: consider extracting the value of the `static` to a `const`, and referring to that
158
159 error[E0013]: constant functions cannot refer to statics
160   --> $DIR/min_const_fn.rs:91:37
161    |
162 LL | const fn foo26() -> &'static u32 { &BAR }
163    |                                     ^^^
164    |
165    = help: consider extracting the value of the `static` to a `const`, and referring to that
166
167 error: pointers cannot be cast to integers during const eval
168   --> $DIR/min_const_fn.rs:92:42
169    |
170 LL | const fn foo30(x: *const u32) -> usize { x as usize }
171    |                                          ^^^^^^^^^^
172    |
173    = note: at compile-time, pointers do not have an integer value
174    = note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
175
176 error: pointers cannot be cast to integers during const eval
177   --> $DIR/min_const_fn.rs:94:63
178    |
179 LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
180    |                                                               ^^^^^^^^^^
181    |
182    = note: at compile-time, pointers do not have an integer value
183    = note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
184
185 error: pointers cannot be cast to integers during const eval
186   --> $DIR/min_const_fn.rs:96:42
187    |
188 LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
189    |                                          ^^^^^^^^^^
190    |
191    = note: at compile-time, pointers do not have an integer value
192    = note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
193
194 error: pointers cannot be cast to integers during const eval
195   --> $DIR/min_const_fn.rs:98:63
196    |
197 LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
198    |                                                               ^^^^^^^^^^
199    |
200    = note: at compile-time, pointers do not have an integer value
201    = note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
202
203 error[E0658]: mutable references are not allowed in constant functions
204   --> $DIR/min_const_fn.rs:101:14
205    |
206 LL | const fn inc(x: &mut i32) { *x += 1 }
207    |              ^
208    |
209    = note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
210    = help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
211
212 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
213   --> $DIR/min_const_fn.rs:110:6
214    |
215 LL | impl<T: std::fmt::Debug> Foo<T> {
216    |      ^
217 LL |
218 LL |     const fn foo(&self) {}
219    |     ------------------- function declared as const here
220    |
221    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
222    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
223
224 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
225   --> $DIR/min_const_fn.rs:115:6
226    |
227 LL | impl<T: std::fmt::Debug + Sized> Foo<T> {
228    |      ^
229 LL |
230 LL |     const fn foo2(&self) {}
231    |     -------------------- function declared as const here
232    |
233    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
234    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
235
236 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
237   --> $DIR/min_const_fn.rs:120:6
238    |
239 LL | impl<T: Sync + Sized> Foo<T> {
240    |      ^
241 LL |
242 LL |     const fn foo3(&self) {}
243    |     -------------------- function declared as const here
244    |
245    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
246    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
247
248 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
249   --> $DIR/min_const_fn.rs:126:34
250    |
251 LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
252    |                                  ^^^^^^^^^^^^^^^^^^^^
253    |
254    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
255    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
256
257 error[E0493]: destructors cannot be evaluated at compile-time
258   --> $DIR/min_const_fn.rs:126:19
259    |
260 LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
261    |                   ^^                                     - value is dropped here
262    |                   |
263    |                   constant functions cannot evaluate destructors
264
265 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
266   --> $DIR/min_const_fn.rs:129:22
267    |
268 LL | const fn no_apit(_x: impl std::fmt::Debug) {}
269    |                      ^^^^^^^^^^^^^^^^^^^^
270    |
271    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
272    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
273
274 error[E0493]: destructors cannot be evaluated at compile-time
275   --> $DIR/min_const_fn.rs:129:18
276    |
277 LL | const fn no_apit(_x: impl std::fmt::Debug) {}
278    |                  ^^                         - value is dropped here
279    |                  |
280    |                  constant functions cannot evaluate destructors
281
282 error[E0658]: trait objects in const fn are unstable
283   --> $DIR/min_const_fn.rs:132:23
284    |
285 LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {}
286    |                       ^^
287    |
288    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
289    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
290
291 error[E0658]: trait objects in const fn are unstable
292   --> $DIR/min_const_fn.rs:134:32
293    |
294 LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
295    |                                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
296    |
297    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
298    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
299
300 error[E0658]: trait objects in const fn are unstable
301   --> $DIR/min_const_fn.rs:139:41
302    |
303 LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 }
304    | -------------------------------------   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
305    | |
306    | function declared as const here
307    |
308    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
309    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
310
311 error[E0658]: trait objects in const fn are unstable
312   --> $DIR/min_const_fn.rs:139:42
313    |
314 LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 }
315    | -------------------------------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
316    | |
317    | function declared as const here
318    |
319    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
320    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
321
322 error[E0658]: trait objects in const fn are unstable
323   --> $DIR/min_const_fn.rs:139:42
324    |
325 LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 }
326    | -------------------------------------    ^^^^^^^^^^^^^^^^^^^^^^^^^^^
327    | |
328    | function declared as const here
329    |
330    = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
331    = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
332
333 error[E0658]: function pointers cannot appear in constant functions
334   --> $DIR/min_const_fn.rs:144:21
335    |
336 LL | const fn no_fn_ptrs(_x: fn()) {}
337    |                     ^^
338    |
339    = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
340    = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
341
342 error[E0658]: function pointers cannot appear in constant functions
343   --> $DIR/min_const_fn.rs:146:27
344    |
345 LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
346    |                           ^^^^
347    |
348    = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
349    = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
350
351 error[E0658]: function pointer casts are not allowed in constant functions
352   --> $DIR/min_const_fn.rs:146:46
353    |
354 LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
355    |                                              ^^^
356    |
357    = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
358    = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
359
360 error: aborting due to 39 previous errors
361
362 Some errors have detailed explanations: E0013, E0493, E0658.
363 For more information about an error, try `rustc --explain E0013`.