1
Fork 0

Subst gat normalize pred correctly

This commit is contained in:
Michael Goulet 2023-03-22 04:32:23 +00:00
parent 6dc3999c26
commit 08284449a2
2 changed files with 18 additions and 1 deletions

View file

@ -1958,7 +1958,7 @@ pub(super) fn check_type_bounds<'tcx>(
let container_id = impl_ty.container_id(tcx);
let rebased_substs = impl_ty_substs.rebase_onto(tcx, container_id, impl_trait_ref.substs);
let impl_ty_value = tcx.type_of(impl_ty.def_id).subst_identity();
let impl_ty_value = tcx.type_of(impl_ty.def_id).subst(tcx, impl_ty_substs);
let param_env = tcx.param_env(impl_ty.def_id);

View file

@ -0,0 +1,17 @@
// check-pass
trait Foo {
type Assoc<T>: PartialEq<Self::Assoc<i32>>;
}
impl Foo for () {
type Assoc<T> = Wrapper<T>;
}
struct Wrapper<T>(T);
impl<T> PartialEq<Wrapper<i32>> for Wrapper<T> {
fn eq(&self, _other: &Wrapper<i32>) -> bool { true }
}
fn main() {}