about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src/glue.rs
diff options
context:
space:
mode:
authorCharles Lew <crlf0710@gmail.com>2021-06-14 18:02:53 +0800
committerCharles Lew <crlf0710@gmail.com>2021-06-15 01:59:00 +0800
commita86d3a7e45e6c4db749df018678ef587ace21933 (patch)
tree6c7cd6bc34a3c66b00cb11a916bacb47bd957016 /compiler/rustc_codegen_ssa/src/glue.rs
parent14831568d506b5ee7be3e7d5a2f029ce9048b609 (diff)
downloadrust-a86d3a7e45e6c4db749df018678ef587ace21933.tar.gz
rust-a86d3a7e45e6c4db749df018678ef587ace21933.zip
Refactor to make interpreter and codegen backend neutral to vtable internal representation.
Diffstat (limited to 'compiler/rustc_codegen_ssa/src/glue.rs')
-rw-r--r--compiler/rustc_codegen_ssa/src/glue.rs7
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/glue.rs b/compiler/rustc_codegen_ssa/src/glue.rs
index b88de0b2411..cf217b52c86 100644
--- a/compiler/rustc_codegen_ssa/src/glue.rs
+++ b/compiler/rustc_codegen_ssa/src/glue.rs
@@ -23,7 +23,12 @@ pub fn size_and_align_of_dst<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>>(
         ty::Dynamic(..) => {
             // load size/align from vtable
             let vtable = info.unwrap();
-            (meth::SIZE.get_usize(bx, vtable), meth::ALIGN.get_usize(bx, vtable))
+            (
+                meth::VirtualIndex::from_index(ty::COMMON_VTABLE_ENTRIES_SIZE)
+                    .get_usize(bx, vtable),
+                meth::VirtualIndex::from_index(ty::COMMON_VTABLE_ENTRIES_ALIGN)
+                    .get_usize(bx, vtable),
+            )
         }
         ty::Slice(_) | ty::Str => {
             let unit = layout.field(bx, 0);