Skip to content

Commit 90a6f2b

Browse files
Do not treat vtable supertraits as distinct when bound with different bound vars
1 parent 600999a commit 90a6f2b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/common.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,12 @@ impl<'gcc, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
234234
GlobalAlloc::VTable(ty, dyn_ty) => {
235235
let alloc = self
236236
.tcx
237-
.global_alloc(self.tcx.vtable_allocation((ty, dyn_ty.principal())))
237+
.global_alloc(self.tcx.vtable_allocation((
238+
ty,
239+
dyn_ty.principal().map(|principal| {
240+
self.tcx.instantiate_bound_regions_with_erased(principal)
241+
}),
242+
)))
238243
.unwrap_memory();
239244
let init = const_alloc_to_gcc(self, alloc);
240245
self.static_addr_of(init, alloc.inner().align, None)

0 commit comments

Comments
 (0)