Skip to content

Commit 0828444

Browse files
Subst gat normalize pred correctly
1 parent 6dc3999 commit 0828444

File tree

2 files changed

+18
-1
lines changed

2 files changed

+18
-1
lines changed

Diff for: compiler/rustc_hir_analysis/src/check/compare_impl_item.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1958,7 +1958,7 @@ pub(super) fn check_type_bounds<'tcx>(
19581958
let container_id = impl_ty.container_id(tcx);
19591959

19601960
let rebased_substs = impl_ty_substs.rebase_onto(tcx, container_id, impl_trait_ref.substs);
1961-
let impl_ty_value = tcx.type_of(impl_ty.def_id).subst_identity();
1961+
let impl_ty_value = tcx.type_of(impl_ty.def_id).subst(tcx, impl_ty_substs);
19621962

19631963
let param_env = tcx.param_env(impl_ty.def_id);
19641964

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// check-pass
2+
3+
trait Foo {
4+
type Assoc<T>: PartialEq<Self::Assoc<i32>>;
5+
}
6+
7+
impl Foo for () {
8+
type Assoc<T> = Wrapper<T>;
9+
}
10+
11+
struct Wrapper<T>(T);
12+
13+
impl<T> PartialEq<Wrapper<i32>> for Wrapper<T> {
14+
fn eq(&self, _other: &Wrapper<i32>) -> bool { true }
15+
}
16+
17+
fn main() {}

0 commit comments

Comments
 (0)