about summary refs log tree commit diff
path: root/compiler/rustc_codegen_gcc
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2025-01-10 04:36:11 +0000
committerMichael Goulet <michael@errs.io>2025-01-30 15:33:58 +0000
commitfdc4bd22b7b8117f4a3864c342773df600f5b956 (patch)
tree404a8293a3401144634e980e436c1b7ca1faac18 /compiler/rustc_codegen_gcc
parent37a430e6ea0a674287b53a017497b3414e44b93d (diff)
downloadrust-fdc4bd22b7b8117f4a3864c342773df600f5b956.tar.gz
rust-fdc4bd22b7b8117f4a3864c342773df600f5b956.zip
Do not treat vtable supertraits as distinct when bound with different bound vars
Diffstat (limited to 'compiler/rustc_codegen_gcc')
-rw-r--r--compiler/rustc_codegen_gcc/src/common.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_gcc/src/common.rs b/compiler/rustc_codegen_gcc/src/common.rs
index bd5d6ba387c..20a3482aaa2 100644
--- a/compiler/rustc_codegen_gcc/src/common.rs
+++ b/compiler/rustc_codegen_gcc/src/common.rs
@@ -234,7 +234,12 @@ impl<'gcc, 'tcx> ConstCodegenMethods<'tcx> for CodegenCx<'gcc, 'tcx> {
                     GlobalAlloc::VTable(ty, dyn_ty) => {
                         let alloc = self
                             .tcx
-                            .global_alloc(self.tcx.vtable_allocation((ty, dyn_ty.principal())))
+                            .global_alloc(self.tcx.vtable_allocation((
+                                ty,
+                                dyn_ty.principal().map(|principal| {
+                                    self.tcx.instantiate_bound_regions_with_erased(principal)
+                                }),
+                            )))
                             .unwrap_memory();
                         let init = const_alloc_to_gcc(self, alloc);
                         self.static_addr_of(init, alloc.inner().align, None)