2023-11-11 15:01:58 +01:00
|
|
|
error: `~const` is not allowed here
|
2024-12-09 19:34:43 +00:00
|
|
|
--> $DIR/super-traits-fail-3.rs:23:12
|
2023-11-11 15:01:58 +01:00
|
|
|
|
|
|
|
|
|
LL | trait Bar: ~const Foo {}
|
2023-11-24 14:32:05 +00:00
|
|
|
| ^^^^^^
|
2023-11-11 15:01:58 +01:00
|
|
|
|
|
|
|
|
|
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
|
2024-12-09 19:34:43 +00:00
|
|
|
--> $DIR/super-traits-fail-3.rs:23:1
|
2023-11-11 15:01:58 +01:00
|
|
|
|
|
|
|
|
|
LL | trait Bar: ~const Foo {}
|
|
|
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
|
|
2023-12-18 17:55:55 +01:00
|
|
|
error: `~const` can only be applied to `#[const_trait]` traits
|
2024-12-09 19:34:43 +00:00
|
|
|
--> $DIR/super-traits-fail-3.rs:32:17
|
2022-10-03 17:08:42 +00:00
|
|
|
|
|
|
|
|
|
LL | const fn foo<T: ~const Bar>(x: &T) {
|
2024-12-09 19:34:43 +00:00
|
|
|
| ^^^^^^ can't be applied to `Bar`
|
|
|
|
|
|
|
|
|
|
|
help: mark `Bar` as `#[const_trait]` to allow it to have `const` implementations
|
|
|
|
|
|
|
|
|
|
|
LL | #[const_trait] trait Bar: ~const Foo {}
|
|
|
|
|
| ++++++++++++++
|
2022-10-03 17:08:42 +00:00
|
|
|
|
2024-10-20 19:49:11 +00:00
|
|
|
error: `~const` can only be applied to `#[const_trait]` traits
|
2024-12-09 19:34:43 +00:00
|
|
|
--> $DIR/super-traits-fail-3.rs:32:17
|
2024-06-25 09:50:01 +00:00
|
|
|
|
|
2024-10-20 19:49:11 +00:00
|
|
|
LL | const fn foo<T: ~const Bar>(x: &T) {
|
2024-12-09 19:34:43 +00:00
|
|
|
| ^^^^^^ can't be applied to `Bar`
|
2024-06-25 09:50:01 +00:00
|
|
|
|
|
2024-10-20 19:49:11 +00:00
|
|
|
= note: duplicate diagnostic emitted due to `-Z deduplicate-diagnostics=no`
|
2024-12-09 19:34:43 +00:00
|
|
|
help: mark `Bar` as `#[const_trait]` to allow it to have `const` implementations
|
|
|
|
|
|
|
|
|
|
|
LL | #[const_trait] trait Bar: ~const Foo {}
|
|
|
|
|
| ++++++++++++++
|
2024-10-20 19:49:11 +00:00
|
|
|
|
|
|
|
|
error[E0277]: the trait bound `T: ~const Foo` is not satisfied
|
2024-12-09 19:34:43 +00:00
|
|
|
--> $DIR/super-traits-fail-3.rs:36:7
|
2023-10-31 13:45:26 +00:00
|
|
|
|
|
2024-10-20 19:49:11 +00:00
|
|
|
LL | x.a();
|
2024-11-24 01:15:04 +00:00
|
|
|
| ^
|
2023-10-31 13:45:26 +00:00
|
|
|
|
2024-10-20 19:49:11 +00:00
|
|
|
error: aborting due to 4 previous errors
|
2022-10-03 17:08:42 +00:00
|
|
|
|
2024-06-25 09:50:01 +00:00
|
|
|
For more information about this error, try `rustc --explain E0277`.
|