Open
Description
trait Foo: Sized {
type Output;
fn func() -> Self;
}
struct Type<T> { value: T }
impl<T: Default> Foo for Type<T> {
type Output = Self;
fn func() -> Self {
Self::Output { value: Default::default() }
}
}
stores the following resolution for Self::Output
via fn write_resolution
:
Ok((AssocTy, DefId(0:4 ~ test1[f74d]::Foo::Output)))
the node_substs
for Self::Output
are however empty. This makes the stored resolution completely useless as there isn't really a way to go from Foo::Output
to Type<T>::Output
which is what we actually need.
We should probably store <Foo as Type<T>>::Output
instead. This happens here
rust/compiler/rustc_typeck/src/check/fn_ctxt/checks.rs
Lines 1592 to 1605 in 7425fb2