Skip to content

Commit c6765bf

Browse files
nia-eRalfJung
andcommitted
Apply suggestions from code review
Co-authored-by: Ralf Jung <[email protected]>
1 parent 5d46a45 commit c6765bf

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/shims/native_lib/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -272,7 +272,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
272272

273273
/// Extract the value from the result of reading an operand from the machine
274274
/// and convert it to a `CArg`.
275-
fn op_to_carg(&self, v: &OpTy<'tcx>, tracing: bool) -> InterpResult<'tcx, CArg> {
275+
fn op_to_ffi_arg(&self, v: &OpTy<'tcx>, tracing: bool) -> InterpResult<'tcx, CArg> {
276276
let this = self.eval_context_ref();
277277
let scalar = |v| interp_ok(this.read_immediate(v)?.to_scalar());
278278
interp_ok(match v.layout.ty.kind() {
@@ -337,7 +337,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
337337
let ptr_raw = this.get_alloc_bytes_unchecked_raw(id)?;
338338
// SAFETY: We know for sure that at ptr_raw the next layout.size bytes
339339
// are part of this allocation and initialised. They might be marked as
340-
// uninit in Miri, but all bytes returned by the isolated allocator are
340+
// uninit in Miri, but all bytes returned by `MiriAllocBytes` are
341341
// initialised.
342342
unsafe {
343343
std::slice::from_raw_parts(ptr_raw, mplace.layout.size.bytes_usize())
@@ -379,7 +379,7 @@ trait EvalContextExtPriv<'tcx>: crate::MiriInterpCxExt<'tcx> {
379379
}
380380
// TODO: unions, etc.
381381
if !adt_def.is_struct() {
382-
throw_unsup_format!("unsupported argument type for native call: {orig_ty}");
382+
throw_unsup_format!("unsupported argument type for native call: {orig_ty} is an enum or union");
383383
}
384384

385385
let this = self.eval_context_ref();

0 commit comments

Comments
 (0)