= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
-error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
- --> $DIR/min_const_fn.rs:84:16
- |
-LL | const fn foo11<T: std::fmt::Display>(t: T) -> T { t }
- | ^
- |
- = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
- = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
-
-error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
- --> $DIR/min_const_fn.rs:86:18
- |
-LL | const fn foo11_2<T: Send>(t: T) -> T { t }
- | ^
- |
- = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
- = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
-
error[E0013]: constant functions cannot refer to statics
- --> $DIR/min_const_fn.rs:90:27
+ --> $DIR/min_const_fn.rs:89:27
|
LL | const fn foo25() -> u32 { BAR }
| ^^^
= help: consider extracting the value of the `static` to a `const`, and referring to that
error[E0013]: constant functions cannot refer to statics
- --> $DIR/min_const_fn.rs:91:37
+ --> $DIR/min_const_fn.rs:90:37
|
LL | const fn foo26() -> &'static u32 { &BAR }
| ^^^
= help: consider extracting the value of the `static` to a `const`, and referring to that
error: pointers cannot be cast to integers during const eval
- --> $DIR/min_const_fn.rs:92:42
+ --> $DIR/min_const_fn.rs:91:42
|
LL | const fn foo30(x: *const u32) -> usize { x as usize }
| ^^^^^^^^^^
= note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
error: pointers cannot be cast to integers during const eval
- --> $DIR/min_const_fn.rs:94:63
+ --> $DIR/min_const_fn.rs:93:63
|
LL | const fn foo30_with_unsafe(x: *const u32) -> usize { unsafe { x as usize } }
| ^^^^^^^^^^
= note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
error: pointers cannot be cast to integers during const eval
- --> $DIR/min_const_fn.rs:96:42
+ --> $DIR/min_const_fn.rs:95:42
|
LL | const fn foo30_2(x: *mut u32) -> usize { x as usize }
| ^^^^^^^^^^
= note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
error: pointers cannot be cast to integers during const eval
- --> $DIR/min_const_fn.rs:98:63
+ --> $DIR/min_const_fn.rs:97:63
|
LL | const fn foo30_2_with_unsafe(x: *mut u32) -> usize { unsafe { x as usize } }
| ^^^^^^^^^^
= note: avoiding this restriction via `transmute`, `union`, or raw pointers leads to compile-time undefined behavior
error[E0658]: mutable references are not allowed in constant functions
- --> $DIR/min_const_fn.rs:101:14
+ --> $DIR/min_const_fn.rs:100:14
|
LL | const fn inc(x: &mut i32) { *x += 1 }
| ^
= note: see issue #57349 <https://github.com/rust-lang/rust/issues/57349> for more information
= help: add `#![feature(const_mut_refs)]` to the crate attributes to enable
-error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
- --> $DIR/min_const_fn.rs:110:6
- |
-LL | impl<T: std::fmt::Debug> Foo<T> {
- | ^
-LL |
-LL | const fn foo(&self) {}
- | ------------------- function declared as const here
- |
- = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
- = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
-
-error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
- --> $DIR/min_const_fn.rs:115:6
- |
-LL | impl<T: std::fmt::Debug + Sized> Foo<T> {
- | ^
-LL |
-LL | const fn foo2(&self) {}
- | -------------------- function declared as const here
- |
- = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
- = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
-
-error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
- --> $DIR/min_const_fn.rs:120:6
- |
-LL | impl<T: Sync + Sized> Foo<T> {
- | ^
-LL |
-LL | const fn foo3(&self) {}
- | -------------------- function declared as const here
- |
- = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
- = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
-
-error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
- --> $DIR/min_const_fn.rs:126:34
- |
-LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
- | ^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
- = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
-
error[E0493]: destructors cannot be evaluated at compile-time
- --> $DIR/min_const_fn.rs:126:19
+ --> $DIR/min_const_fn.rs:122:19
|
LL | const fn no_apit2(_x: AlanTuring<impl std::fmt::Debug>) {}
| ^^ - value is dropped here
| |
| constant functions cannot evaluate destructors
-error[E0658]: trait bounds other than `Sized` on const fn parameters are unstable
- --> $DIR/min_const_fn.rs:129:22
- |
-LL | const fn no_apit(_x: impl std::fmt::Debug) {}
- | ^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
- = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
-
error[E0493]: destructors cannot be evaluated at compile-time
- --> $DIR/min_const_fn.rs:129:18
+ --> $DIR/min_const_fn.rs:124:18
|
LL | const fn no_apit(_x: impl std::fmt::Debug) {}
| ^^ - value is dropped here
| |
| constant functions cannot evaluate destructors
-error[E0658]: trait objects in const fn are unstable
- --> $DIR/min_const_fn.rs:132:23
- |
-LL | const fn no_dyn_trait(_x: &dyn std::fmt::Debug) {}
- | ^^
- |
- = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
- = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
-
-error[E0658]: trait objects in const fn are unstable
- --> $DIR/min_const_fn.rs:134:32
- |
-LL | const fn no_dyn_trait_ret() -> &'static dyn std::fmt::Debug { &() }
- | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- |
- = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
- = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
-
-error[E0658]: trait objects in const fn are unstable
- --> $DIR/min_const_fn.rs:139:41
- |
-LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 }
- | ------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | function declared as const here
- |
- = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
- = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
-
-error[E0658]: trait objects in const fn are unstable
- --> $DIR/min_const_fn.rs:139:42
- |
-LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 }
- | ------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | function declared as const here
- |
- = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
- = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
-
-error[E0658]: trait objects in const fn are unstable
- --> $DIR/min_const_fn.rs:139:42
- |
-LL | const fn really_no_traits_i_mean_it() { (&() as &dyn std::fmt::Debug, ()).1 }
- | ------------------------------------- ^^^^^^^^^^^^^^^^^^^^^^^^^^^
- | |
- | function declared as const here
- |
- = note: see issue #93706 <https://github.com/rust-lang/rust/issues/93706> for more information
- = help: add `#![feature(const_fn_trait_bound)]` to the crate attributes to enable
-
-error[E0658]: function pointers cannot appear in constant functions
- --> $DIR/min_const_fn.rs:144:21
- |
-LL | const fn no_fn_ptrs(_x: fn()) {}
- | ^^
- |
- = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
- = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
-
-error[E0658]: function pointers cannot appear in constant functions
- --> $DIR/min_const_fn.rs:146:27
- |
-LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
- | ^^^^
- |
- = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
- = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
-
-error[E0658]: function pointer casts are not allowed in constant functions
- --> $DIR/min_const_fn.rs:146:46
- |
-LL | const fn no_fn_ptrs2() -> fn() { fn foo() {} foo }
- | ^^^
- |
- = note: see issue #57563 <https://github.com/rust-lang/rust/issues/57563> for more information
- = help: add `#![feature(const_fn_fn_ptr_basics)]` to the crate attributes to enable
-
-error: aborting due to 39 previous errors
+error: aborting due to 24 previous errors
Some errors have detailed explanations: E0013, E0493, E0658.
For more information about an error, try `rustc --explain E0013`.