rust/tests/ui/specialization/const_trait_impl.stderr
Esteban Küber c3301503b9 Make Default const and add some const Default impls
Full list of `impl const Default` types:

- ()
- bool
- char
- Cell
- std::ascii::Char
- usize
- u8
- u16
- u32
- u64
- u128
- i8
- i16
- i32
- i64
- i128
- f16
- f32
- f64
- f128
- std::marker::PhantomData<T>
- Option<T>
- std::iter::Empty<T>
- std::ptr::Alignment
- &[T]
- &mut [T]
- &str
- &mut str
- String
- Vec<T>
2025-07-07 22:09:37 +00:00

60 lines
2.3 KiB
Plaintext

error: `[const]` can only be applied to `#[const_trait]` traits
--> $DIR/const_trait_impl.rs:36:9
|
LL | impl<T: [const] Debug> const A for T {
| ^^^^^^^ can't be applied to `Debug`
|
note: `Debug` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
error: `[const]` can only be applied to `#[const_trait]` traits
--> $DIR/const_trait_impl.rs:42:9
|
LL | impl<T: [const] Debug + [const] Sup> const A for T {
| ^^^^^^^ can't be applied to `Debug`
|
note: `Debug` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
error: `[const]` can only be applied to `#[const_trait]` traits
--> $DIR/const_trait_impl.rs:48:9
|
LL | impl<T: [const] Debug + [const] Sub> const A for T {
| ^^^^^^^ can't be applied to `Debug`
|
note: `Debug` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
error: `[const]` can only be applied to `#[const_trait]` traits
--> $DIR/const_trait_impl.rs:42:9
|
LL | impl<T: [const] Debug + [const] Sup> const A for T {
| ^^^^^^^ can't be applied to `Debug`
|
note: `Debug` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: `[const]` can only be applied to `#[const_trait]` traits
--> $DIR/const_trait_impl.rs:36:9
|
LL | impl<T: [const] Debug> const A for T {
| ^^^^^^^ can't be applied to `Debug`
|
note: `Debug` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: `[const]` can only be applied to `#[const_trait]` traits
--> $DIR/const_trait_impl.rs:48:9
|
LL | impl<T: [const] Debug + [const] Sub> const A for T {
| ^^^^^^^ can't be applied to `Debug`
|
note: `Debug` can't be used with `[const]` because it isn't annotated with `#[const_trait]`
--> $SRC_DIR/core/src/fmt/mod.rs:LL:COL
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
error: aborting due to 6 previous errors