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() {}
Run Code Online (Sandbox Code Playgroud)
为什么线条为标志"这不会编译"编译失败(即使From<T>是所有已经实现T),而一个标有"但这会"(这取决于毯子IMPL上Into从From标准库)会?
我怀疑这是一个合法的错误,但宁愿避免提交任何内容并增加噪音,如果只是一些特别的东西From,Into我不知道.