diff options
| author | Charles Lew <crlf0710@gmail.com> | 2021-06-14 18:02:53 +0800 |
|---|---|---|
| committer | Charles Lew <crlf0710@gmail.com> | 2021-06-15 01:59:00 +0800 |
| commit | a86d3a7e45e6c4db749df018678ef587ace21933 (patch) | |
| tree | 6c7cd6bc34a3c66b00cb11a916bacb47bd957016 /compiler/rustc_codegen_ssa/src/mir | |
| parent | 14831568d506b5ee7be3e7d5a2f029ce9048b609 (diff) | |
| download | rust-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/mir')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/block.rs | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/block.rs b/compiler/rustc_codegen_ssa/src/mir/block.rs index 93200bd1f26..2cb28d7361c 100644 --- a/compiler/rustc_codegen_ssa/src/mir/block.rs +++ b/compiler/rustc_codegen_ssa/src/mir/block.rs @@ -332,7 +332,11 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> { let fn_abi = FnAbi::of_instance(&bx, virtual_drop, &[]); let vtable = args[1]; args = &args[..1]; - (meth::DESTRUCTOR.get_fn(&mut bx, vtable, &fn_abi), fn_abi) + ( + meth::VirtualIndex::from_index(ty::COMMON_VTABLE_ENTRIES_DROPINPLACE) + .get_fn(&mut bx, vtable, &fn_abi), + fn_abi, + ) } _ => (bx.get_fn_addr(drop_fn), FnAbi::of_instance(&bx, drop_fn, &[])), }; |
