2025-07-13 16:49:19 +08:00
|
|
|
error: const `impl` for trait `Foo` which is not `const`
|
2024-10-30 18:03:44 +00:00
|
|
|
--> $DIR/spec-effectvar-ice.rs:10:15
|
2024-06-01 14:59:13 -04:00
|
|
|
|
|
|
|
|
|
LL | impl<T> const Foo for T {}
|
2024-12-09 19:34:43 +00:00
|
|
|
| ^^^ this trait is not `const`
|
2024-06-01 14:59:13 -04:00
|
|
|
|
|
2025-07-13 16:49:19 +08:00
|
|
|
= note: marking a trait with `const` ensures all default method bodies are `const`
|
2024-06-01 14:59:13 -04:00
|
|
|
= note: adding a non-const method body in the future would be a breaking change
|
2025-07-13 16:49:19 +08:00
|
|
|
help: mark `Foo` as `const` to allow it to have `const` implementations
|
2024-12-09 19:34:43 +00:00
|
|
|
|
|
|
|
|
|
LL | #[const_trait] trait Foo {}
|
|
|
|
|
| ++++++++++++++
|
2024-06-01 14:59:13 -04:00
|
|
|
|
2025-07-13 16:49:19 +08:00
|
|
|
error: const `impl` for trait `Foo` which is not `const`
|
2024-10-30 18:03:44 +00:00
|
|
|
--> $DIR/spec-effectvar-ice.rs:13:15
|
2024-06-01 14:59:13 -04:00
|
|
|
|
|
|
|
|
|
LL | impl<T> const Foo for T where T: const Specialize {}
|
2024-12-09 19:34:43 +00:00
|
|
|
| ^^^ this trait is not `const`
|
2024-06-01 14:59:13 -04:00
|
|
|
|
|
2025-07-13 16:49:19 +08:00
|
|
|
= note: marking a trait with `const` ensures all default method bodies are `const`
|
2024-06-01 14:59:13 -04:00
|
|
|
= note: adding a non-const method body in the future would be a breaking change
|
2025-07-13 16:49:19 +08:00
|
|
|
help: mark `Foo` as `const` to allow it to have `const` implementations
|
2024-12-09 19:34:43 +00:00
|
|
|
|
|
|
|
|
|
LL | #[const_trait] trait Foo {}
|
|
|
|
|
| ++++++++++++++
|
2024-06-01 14:59:13 -04:00
|
|
|
|
2025-07-13 16:49:19 +08:00
|
|
|
error: `const` can only be applied to `const` traits
|
2024-10-30 18:03:44 +00:00
|
|
|
--> $DIR/spec-effectvar-ice.rs:13:34
|
2024-06-01 14:59:13 -04:00
|
|
|
|
|
|
|
|
|
LL | impl<T> const Foo for T where T: const Specialize {}
|
2024-12-09 19:34:43 +00:00
|
|
|
| ^^^^^ can't be applied to `Specialize`
|
|
|
|
|
|
|
2025-07-13 16:49:19 +08:00
|
|
|
help: mark `Specialize` as `const` to allow it to have `const` implementations
|
2024-12-09 19:34:43 +00:00
|
|
|
|
|
|
|
|
|
LL | #[const_trait] trait Specialize {}
|
|
|
|
|
| ++++++++++++++
|
2024-06-01 14:59:13 -04:00
|
|
|
|
2024-06-25 09:50:01 +00:00
|
|
|
error: specialization impl does not specialize any associated items
|
2024-10-30 18:03:44 +00:00
|
|
|
--> $DIR/spec-effectvar-ice.rs:13:1
|
2024-06-01 14:59:13 -04:00
|
|
|
|
|
2024-06-25 09:50:01 +00:00
|
|
|
LL | impl<T> const Foo for T where T: const Specialize {}
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
2024-06-01 14:59:13 -04:00
|
|
|
|
|
2024-06-25 09:50:01 +00:00
|
|
|
note: impl is a specialization of this impl
|
2024-10-30 18:03:44 +00:00
|
|
|
--> $DIR/spec-effectvar-ice.rs:10:1
|
2024-06-04 09:10:08 +01:00
|
|
|
|
|
|
|
|
|
LL | impl<T> const Foo for T {}
|
2024-06-25 09:50:01 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^
|
2024-06-04 09:10:08 +01:00
|
|
|
|
2024-06-25 09:50:01 +00:00
|
|
|
error: cannot specialize on trait `Specialize`
|
2024-10-30 18:03:44 +00:00
|
|
|
--> $DIR/spec-effectvar-ice.rs:13:34
|
2024-06-01 14:59:13 -04:00
|
|
|
|
|
|
|
|
|
LL | impl<T> const Foo for T where T: const Specialize {}
|
2024-06-25 09:50:01 +00:00
|
|
|
| ^^^^^^^^^^^^^^^^
|
2024-06-01 14:59:13 -04:00
|
|
|
|
2024-10-30 18:03:44 +00:00
|
|
|
error: aborting due to 5 previous errors
|
2024-06-01 14:59:13 -04:00
|
|
|
|