Closed
Description
I'm trying to use a where
clause to define one trait in terms of another, as applied to a wrapper type:
struct Wrapper<T>(T);
trait Base {}
trait Wrapped: Sized where Wrapper<Self>: Base {}
fn wat<F: Wrapped>() {}
But when I try to bound by the new trait, I get a strange error:
error[E0277]: the trait bound `Wrapper<F>: Base` is not satisfied
--> src/main.rs:7:1
|
7 | fn wat<F: Wrapped>() {}
| ^^^^^^^^^^^^^^^^^^^^^^^ the trait `Base` is not implemented for `Wrapper<F>`
|
note: required by `Wrapped`
--> src/main.rs:5:1
|
5 | trait Wrapped: Sized where Wrapper<Self>: Base {}
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^