Skip to content

Commit 9f44caa

Browse files
Do not treat vtable supertraits as distinct when bound with different bound vars
1 parent 7b19e13 commit 9f44caa

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

Diff for: src/constant.rs

+4-1
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,10 @@ pub(crate) fn data_id_for_vtable<'tcx>(
245245
ty: Ty<'tcx>,
246246
trait_ref: Option<Binder<'tcx, ExistentialTraitRef<'tcx>>>,
247247
) -> DataId {
248-
let alloc_id = tcx.vtable_allocation((ty, trait_ref));
248+
let alloc_id = tcx.vtable_allocation((
249+
ty,
250+
trait_ref.map(|principal| tcx.instantiate_bound_regions_with_erased(principal)),
251+
));
249252
data_id_for_alloc_id(cx, module, alloc_id, Mutability::Not)
250253
}
251254

0 commit comments

Comments
 (0)