trait A<'self_> { type T; } trait B: for<'self_> A<'self_> { type U: for<'self_> From<<Self as A<'self_>>::T>; // <-- this won't compile // type U: for<'self_> Into<<Self as A<'self_>>::T>; // <-- but this will } struct M; impl<'self_> A<'self_> for M { type T = usize; } impl B for M { type U = usize; } fn main() {}
playpen link
Why the line marked as “this will not compile” will not compile (although From<T> is implemented for all T ), while the character marked “but it will” (which depends on whether Into depends on From in the standard library) ?
I suspect this is a legitimate mistake, but it would be better not to record anything and add to the noise, if just something special in From vs. Into that I did not know about.
source share