Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit faa688b

Browse files
committedOct 13, 2018
Add comments to remind everyone to keep the get_vtable impls in sync
1 parent 69b1c95 commit faa688b

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed
 

‎src/librustc_codegen_llvm/meth.rs

+4
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,10 @@ pub fn get_vtable(
8787
let nullptr = C_null(Type::i8p(cx));
8888

8989
let (size, align) = cx.size_and_align_of(ty);
90+
// /////////////////////////////////////////////////////////////////////////////////////////////
91+
// If you touch this code, be sure to also make the corresponding changes to
92+
// `get_vtable` in rust_mir/interpret/traits.rs
93+
// /////////////////////////////////////////////////////////////////////////////////////////////
9094
let mut components: Vec<_> = [
9195
callee::get_fn(cx, monomorphize::resolve_drop_in_place(cx.tcx, ty)),
9296
C_usize(cx, size.bytes()),

‎src/librustc_mir/interpret/traits.rs

+4
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,10 @@ impl<'a, 'mir, 'tcx, M: Machine<'a, 'mir, 'tcx>> EvalContext<'a, 'mir, 'tcx, M>
4848

4949
let ptr_size = self.pointer_size();
5050
let ptr_align = self.tcx.data_layout.pointer_align;
51+
// /////////////////////////////////////////////////////////////////////////////////////////
52+
// If you touch this code, be sure to also make the corresponding changes to
53+
// `get_vtable` in rust_codegen_llvm/meth.rs
54+
// /////////////////////////////////////////////////////////////////////////////////////////
5155
let vtable = self.memory.allocate(
5256
ptr_size * (3 + methods.as_ref().map_or(0, |m| m.len() as u64)),
5357
ptr_align,

0 commit comments

Comments
 (0)
Please sign in to comment.