1 error[E0493]: destructors cannot be evaluated at compile-time
2 --> $DIR/min_const_fn.rs:37:25
4 LL | const fn into_inner(self) -> T { self.0 }
5 | ^^^^ - value is dropped here
7 | constant functions cannot evaluate destructors
9 error[E0658]: mutable references are not allowed in constant functions
10 --> $DIR/min_const_fn.rs:39:22
12 LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 }
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
18 error[E0658]: mutable references are not allowed in constant functions
19 --> $DIR/min_const_fn.rs:39:36
21 LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 }
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
27 error[E0658]: mutable references are not allowed in constant functions
28 --> $DIR/min_const_fn.rs:39:45
30 LL | const fn get_mut(&mut self) -> &mut T { &mut self.0 }
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
36 error[E0493]: destructors cannot be evaluated at compile-time
37 --> $DIR/min_const_fn.rs:46:28
39 LL | const fn into_inner_lt(self) -> T { self.0 }
40 | ^^^^ - value is dropped here
42 | constant functions cannot evaluate destructors
44 error[E0658]: mutable references are not allowed in constant functions
45 --> $DIR/min_const_fn.rs:48:25
47 LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
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
53 error[E0658]: mutable references are not allowed in constant functions
54 --> $DIR/min_const_fn.rs:48:42
56 LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
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
62 error[E0658]: mutable references are not allowed in constant functions
63 --> $DIR/min_const_fn.rs:48:51
65 LL | const fn get_mut_lt(&'a mut self) -> &mut T { &mut self.0 }
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
71 error[E0493]: destructors cannot be evaluated at compile-time
72 --> $DIR/min_const_fn.rs:55:27
74 LL | const fn into_inner_s(self) -> T { self.0 }
75 | ^^^^ - value is dropped here
77 | constant functions cannot evaluate destructors
79 error[E0658]: mutable references are not allowed in constant functions
80 --> $DIR/min_const_fn.rs:57:24
82 LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
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
88 error[E0658]: mutable references are not allowed in constant functions
89 --> $DIR/min_const_fn.rs:57:38
91 LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
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
97 error[E0658]: mutable references are not allowed in constant functions
98 --> $DIR/min_const_fn.rs:57:47
100 LL | const fn get_mut_s(&mut self) -> &mut T { &mut self.0 }
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
106 error[E0658]: mutable references are not allowed in constant functions
107 --> $DIR/min_const_fn.rs:64:25
109 LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
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
115 error[E0658]: mutable references are not allowed in constant functions
116 --> $DIR/min_const_fn.rs:64:39
118 LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
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
124 error[E0658]: mutable references are not allowed in constant functions
125 --> $DIR/min_const_fn.rs:64:48
127 LL | const fn get_mut_sq(&mut self) -> &mut T { &mut self.0 }
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
133 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
134 --> $DIR/min_const_fn.rs:84:16
136 LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
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
142 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
143 --> $DIR/min_const_fn.rs:86:18
145 LL | const fn foo11_2<T: Send>(t: T) -> T { t }
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
151 error[E0013]: constant functions cannot refer to statics
152 --> $DIR/min_const_fn.rs:90:27
154 LL | const fn foo25() -> u32 { BAR }
157 = help: consider extracting the value of the `static` to a `const`, and referring to that
159 error[E0013]: constant functions cannot refer to statics
160 --> $DIR/min_const_fn.rs:91:37
162 LL | const fn foo26() -> &'static u32 { &BAR }
165 = help: consider extracting the value of the `static` to a `const`, and referring to that
167 error: pointers cannot be cast to integers during const eval
168 --> $DIR/min_const_fn.rs:92:42
170 LL | const fn foo30(x: *const u32) -> usize { x as usize }
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
176 error: pointers cannot be cast to integers during const eval
177 --> $DIR/min_const_fn.rs:94:63
179 LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
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
185 error: pointers cannot be cast to integers during const eval
186 --> $DIR/min_const_fn.rs:96:42
188 LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
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
194 error: pointers cannot be cast to integers during const eval
195 --> $DIR/min_const_fn.rs:98:63
197 LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
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
203 error[E0658]: mutable references are not allowed in constant functions
204 --> $DIR/min_const_fn.rs:101:14
206 LL | const fn inc(x: &mut i32) { *x += 1 }
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
212 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
213 --> $DIR/min_const_fn.rs:110:6
215 LL | impl<T: std::fmt::Debug> Foo<T> {
218 LL | const fn foo(&self) {}
219 | ------------------- function declared as const here
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
224 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
225 --> $DIR/min_const_fn.rs:115:6
227 LL | impl<T: std::fmt::Debug + Sized> Foo<T> {
230 LL | const fn foo2(&self) {}
231 | -------------------- function declared as const here
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
236 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
237 --> $DIR/min_const_fn.rs:120:6
239 LL | impl<T: Sync + Sized> Foo<T> {
242 LL | const fn foo3(&self) {}
243 | -------------------- function declared as const here
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
248 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
249 --> $DIR/min_const_fn.rs:126:34
251 LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
252 | ^^^^^^^^^^^^^^^^^^^^
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
257 error[E0493]: destructors cannot be evaluated at compile-time
258 --> $DIR/min_const_fn.rs:126:19
260 LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
261 | ^^ - value is dropped here
263 | constant functions cannot evaluate destructors
265 error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
266 --> $DIR/min_const_fn.rs:129:22
268 LL | const fn no_apit(_x: impl std::fmt::Debug) {}
269 | ^^^^^^^^^^^^^^^^^^^^
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
274 error[E0493]: destructors cannot be evaluated at compile-time
275 --> $DIR/min_const_fn.rs:129:18
277 LL | const fn no_apit(_x: impl std::fmt::Debug) {}
278 | ^^ - value is dropped here
280 | constant functions cannot evaluate destructors
282 error[E0658]: trait objects in const fn are unstable
283 --> $DIR/min_const_fn.rs:132:23
285 LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {}
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
291 error[E0658]: trait objects in const fn are unstable
292 --> $DIR/min_const_fn.rs:134:32
294 LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
295 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
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
300 error[E0658]: trait objects in const fn are unstable
301 --> $DIR/min_const_fn.rs:139:41
303 LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 }
304 | ------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
306 | function declared as const here
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
311 error[E0658]: trait objects in const fn are unstable
312 --> $DIR/min_const_fn.rs:139:42
314 LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 }
315 | ------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
317 | function declared as const here
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
322 error[E0658]: trait objects in const fn are unstable
323 --> $DIR/min_const_fn.rs:139:42
325 LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 }
326 | ------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
328 | function declared as const here
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
333 error[E0658]: function pointers cannot appear in constant functions
334 --> $DIR/min_const_fn.rs:144:21
336 LL | const fn no_fn_ptrs(_x: fn()) {}
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
342 error[E0658]: function pointers cannot appear in constant functions
343 --> $DIR/min_const_fn.rs:146:27
345 LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
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
351 error[E0658]: function pointer casts are not allowed in constant functions
352 --> $DIR/min_const_fn.rs:146:46
354 LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
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
360 error: aborting due to 39 previous errors
362 Some errors have detailed explanations: E0013, E0493, E0658.
363 For more information about an error, try `rustc --explain E0013`.