]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_codegen_gcc/src/common.rs
Rollup merge of #101055 - TaKO8Ki:use-smaller-span, r=compiler-errors
[rust.git] / compiler / rustc_codegen_gcc / src / common.rs
index fc391f53f18e7ad9d6d5653fad7d26a944a3f2eb..ccb6cbbc2c8a74bb98ab5a977c8698dea5b7c769 100644 (file)
@@ -201,6 +201,11 @@ fn scalar_to_backend(&self, cv: Scalar, layout: abi::Scalar, ty: Type<'gcc>) ->
                         GlobalAlloc::Function(fn_instance) => {
                             self.get_fn_addr(fn_instance)
                         },
+                        GlobalAlloc::VTable(ty, trait_ref) => {
+                            let alloc = self.tcx.global_alloc(self.tcx.vtable_allocation((ty, trait_ref))).unwrap_memory();
+                            let init = const_alloc_to_gcc(self, alloc);
+                            self.static_addr_of(init, alloc.inner().align, None)
+                        }
                         GlobalAlloc::Static(def_id) => {
                             assert!(self.tcx.is_static(def_id));
                             self.get_static(def_id).get_address(None)