mirror of https://github.com/rust-lang/rust
41 lines
1.3 KiB
Plaintext
41 lines
1.3 KiB
Plaintext
error: `~const` is not allowed here
|
|
--> $DIR/super-traits-fail-3.rs:14:12
|
|
|
|
|
LL | trait Bar: ~const Foo {}
|
|
| ^^^^^^
|
|
|
|
|
note: this trait is not a `#[const_trait]`, so it cannot have `~const` trait bounds
|
|
--> $DIR/super-traits-fail-3.rs:14:1
|
|
|
|
|
LL | trait Bar: ~const Foo {}
|
|
| ^^^^^^^^^^^^^^^^^^^^^^^^
|
|
|
|
error: `~const` can only be applied to `#[const_trait]` traits
|
|
--> $DIR/super-traits-fail-3.rs:20:24
|
|
|
|
|
LL | const fn foo<T: ~const Bar>(x: &T) {
|
|
| ^^^
|
|
|
|
error[E0277]: the trait bound `Foo::{synthetic#0}: ~const Compat` is not satisfied
|
|
--> $DIR/super-traits-fail-3.rs:22:7
|
|
|
|
|
LL | x.a();
|
|
| ^ the trait `~const Compat` is not implemented for `Foo::{synthetic#0}`
|
|
|
|
|
note: required by a bound in `Foo::a`
|
|
--> $DIR/super-traits-fail-3.rs:8:25
|
|
|
|
|
LL | #[cfg_attr(any(yy, yn), const_trait)]
|
|
| ^^^^^^^^^^^ required by this bound in `Foo::a`
|
|
LL | trait Foo {
|
|
LL | fn a(&self);
|
|
| - required by a bound in this associated function
|
|
help: consider further restricting the associated type
|
|
|
|
|
LL | const fn foo<T: ~const Bar>(x: &T) where Foo::{synthetic#0}: ~const Compat {
|
|
| +++++++++++++++++++++++++++++++++++++++
|
|
|
|
error: aborting due to 3 previous errors
|
|
|
|
For more information about this error, try `rustc --explain E0277`.
|