rust/tests/ui/rfcs/rfc-2632-const-trait-impl/trait-where-clause-const.st...

61 lines
2.0 KiB
Plaintext

error[E0277]: the trait bound `Foo::{synthetic#0}: Compat` is not satisfied
--> $DIR/trait-where-clause-const.rs:22:5
|
LL | T::b();
| ^ the trait `Compat` is not implemented for `Foo::{synthetic#0}`
|
note: required by a bound in `Foo::b`
--> $DIR/trait-where-clause-const.rs:13:1
|
LL | #[const_trait]
| ^^^^^^^^^^^^^^ required by this bound in `Foo::b`
...
LL | fn b() where Self: ~const Bar;
| - required by a bound in this associated function
help: consider further restricting the associated type
|
LL | const fn test1<T: ~const Foo + Bar>() where Foo::{synthetic#0}: Compat {
| ++++++++++++++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/trait-where-clause-const.rs:22:5
|
LL | T::b();
| ^^^^^^ expected `host`, found `true`
|
= note: expected constant `host`
found constant `true`
error[E0277]: the trait bound `Foo::{synthetic#0}: Compat` is not satisfied
--> $DIR/trait-where-clause-const.rs:25:5
|
LL | T::c::<T>();
| ^ the trait `Compat` is not implemented for `Foo::{synthetic#0}`
|
note: required by a bound in `Foo::c`
--> $DIR/trait-where-clause-const.rs:13:1
|
LL | #[const_trait]
| ^^^^^^^^^^^^^^ required by this bound in `Foo::c`
...
LL | fn c<T: ~const Bar>();
| - required by a bound in this associated function
help: consider further restricting the associated type
|
LL | const fn test1<T: ~const Foo + Bar>() where Foo::{synthetic#0}: Compat {
| ++++++++++++++++++++++++++++++++
error[E0308]: mismatched types
--> $DIR/trait-where-clause-const.rs:25:5
|
LL | T::c::<T>();
| ^^^^^^^^^^^ expected `host`, found `true`
|
= note: expected constant `host`
found constant `true`
error: aborting due to 4 previous errors
Some errors have detailed explanations: E0277, E0308.
For more information about an error, try `rustc --explain E0277`.