Closed
Description
The following code works fine:
trait Upgr<S> {}
trait Proto {
type S;
type Upgr: Upgr<Self::S>;
}
struct Wrapper<P>(P);
impl<P: Proto> Proto for Wrapper<P> {
type S = P::S;
type Upgr = P::Upgr;
}
However if you change the last few lines for this:
impl<X, P: Proto<S = X>> Proto for Wrapper<P> {
type S = P::S;
type Upgr = P::Upgr;
}
Then you get:
error[E0277]: the trait bound
<P as Proto>::Upgr: Upgr<X>
is not satisfied
Using type S = X;
also doesn't work.
Rust version: nightly.
Apologize if an issue already exists. The vocabulary for this kind of problems is kind of tricky, which makes it hard to search for existing issues.