trace!("miri_start_panic: {:?}", this.frame().instance);
// Get the raw pointer stored in arg[0] (the panic payload).
- let &[ref payload] = this.check_shim(abi, Abi::Rust, link_name, args)?;
+ let [payload] = this.check_shim(abi, Abi::Rust, link_name, args)?;
let payload = this.read_scalar(payload)?.check_init()?;
let thread = this.active_thread_mut();
assert!(thread.panic_payload.is_none(), "the panic runtime should avoid double-panics");
// Jump to the unwind block to begin unwinding.
this.unwind_to_block(unwind)?;
- return Ok(());
+ Ok(())
}
/// Handles the `try` intrinsic, the underlying implementation of `std::panicking::try`.
// a pointer to `Box<dyn Any + Send + 'static>`.
// Get all the arguments.
- let &[ref try_fn, ref data, ref catch_fn] = check_arg_count(args)?;
+ let [try_fn, data, catch_fn] = check_arg_count(args)?;
let try_fn = this.read_pointer(try_fn)?;
let data = this.read_scalar(data)?.check_init()?;
let catch_fn = this.read_scalar(catch_fn)?.check_init()?;
f_instance,
Abi::Rust,
&[data.into()],
- Some(&ret_place),
+ &ret_place,
// Directly return to caller.
StackPopCleanup::Goto { ret: Some(ret), unwind: StackPopUnwind::Skip },
)?;
Some(CatchUnwindData { catch_fn, data, dest: *dest, ret });
}
- return Ok(());
+ Ok(())
}
fn handle_stack_pop(
// Push the `catch_fn` stackframe.
let f_instance =
- this.get_ptr_fn(this.scalar_to_ptr(catch_unwind.catch_fn))?.as_instance()?;
+ this.get_ptr_fn(this.scalar_to_ptr(catch_unwind.catch_fn)?)?.as_instance()?;
trace!("catch_fn: {:?}", f_instance);
let ret_place = MPlaceTy::dangling(this.machine.layouts.unit).into();
this.call_function(
f_instance,
Abi::Rust,
&[catch_unwind.data.into(), payload.into()],
- Some(&ret_place),
+ &ret_place,
// Directly return to caller of `try`.
StackPopCleanup::Goto { ret: Some(catch_unwind.ret), unwind: StackPopUnwind::Skip },
)?;
panic,
Abi::Rust,
&[msg.to_ref(this)],
- None,
+ &MPlaceTy::dangling(this.machine.layouts.unit).into(),
StackPopCleanup::Goto { ret: None, unwind },
)
}
panic_bounds_check,
Abi::Rust,
&[index.into(), len.into()],
- None,
+ &MPlaceTy::dangling(this.machine.layouts.unit).into(),
StackPopCleanup::Goto {
ret: None,
unwind: match unwind {