I have the following code (simplified):
trait A<'a> {
type C;
}
trait B {}
impl<'a, T: A<'a, C = C>, C> B for T {}
The compile fails to compile:
error[E0207]: the type parameter `C` is not constrained by the impl trait, self type, or predicates
--> src/lib.rs:7:27
|
7 | impl<'a, T: A<'a, C = C>, C> B for T {}
| ^ unconstrained type parameter
I don't understand why.
But the really strange thing happens when I remove the lifetime:
trait A {
type C;
}
trait B {}
impl<T: A<C = C>, C> B for T {}
Now the code compiles fine.
I would expect the opposite, if already; the lifetime introduces space for ambiguation, doesn't it?