From 97bc0eefe7566955eedff5fb587807224b2387c3 Mon Sep 17 00:00:00 2001 From: hyd-dev Date: Mon, 17 May 2021 20:54:31 +0800 Subject: [PATCH] Add a comment for `check_abi()` --- compiler/rustc_mir/src/interpret/terminator.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/compiler/rustc_mir/src/interpret/terminator.rs b/compiler/rustc_mir/src/interpret/terminator.rs index d287bc858ed5..a7fcb41f74a9 100644 --- a/compiler/rustc_mir/src/interpret/terminator.rs +++ b/compiler/rustc_mir/src/interpret/terminator.rs @@ -276,6 +276,9 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> { None => return Ok(()), }; + // Check against the ABI of the MIR body we are calling (not the ABI of `instance`; + // these can differ when `find_mir_or_eval_fn` does something clever like resolve + // exported symbol names). check_abi(self, self.tcx.type_of(body.source.def_id()))?; self.push_stack_frame(