Files
rust/tests/ui/traits/const-traits/spec-effectvar-ice.stderr

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

58 lines
2.0 KiB
Plaintext
Raw Normal View History

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
|
LL | impl<T> const Foo for T {}
| ^^^ this trait is not `const`
|
2025-07-13 16:49:19 +08:00
= note: marking a trait with `const` ensures all default method bodies are `const`
= 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
|
LL | #[const_trait] trait Foo {}
| ++++++++++++++
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
|
LL | impl<T> const Foo for T where T: const Specialize {}
| ^^^ this trait is not `const`
|
2025-07-13 16:49:19 +08:00
= note: marking a trait with `const` ensures all default method bodies are `const`
= 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
|
LL | #[const_trait] trait Foo {}
| ++++++++++++++
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
|
LL | impl<T> const Foo for T where T: const Specialize {}
| ^^^^^ 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
|
LL | #[const_trait] trait Specialize {}
| ++++++++++++++
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-25 09:50:01 +00:00
LL | impl<T> const Foo for T where T: const Specialize {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
|
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
|
LL | impl<T> const Foo for T where T: const Specialize {}
2024-06-25 09:50:01 +00:00
| ^^^^^^^^^^^^^^^^
2024-10-30 18:03:44 +00:00
error: aborting due to 5 previous errors