Skip to main content

finish

Function finish 

Source
#[doc(hidden)]
pub unsafe fn finish(mark: usize, value: SEXP, call: Option<SEXP>) -> SEXP
Expand description

Signal everything queued since mark, then return value.

Called by the generated C wrappers with the wrapper’s outcome (the value SEXP, or a tagged condition value when the body failed) and by crate::unwind_protect::with_r_unwind_protect_shim. The queued conditions are materialised as tagged condition values and handed to the R helper (stop() / warning() / message() / signalCondition()), so their R-side shape is identical to the panicking macros’. The signalling runs under its own R_UnwindProtect: an exiting handler unwinds through it like any R error, and a Rust panic inside (a framework bug) comes back as a tagged error value, which replaces value.

call is the wrapper’s call object (conditionCall() of every signalled condition); None gives NULL.

§Safety

Must run on R’s main thread. value need not be protected: it is rooted for the duration of the signalling.