pub(crate) fn with_r_unwind_protect_sourced<F, R>(
f: F,
call: Option<SEXP>,
source: PanicSource,
) -> Rwhere
F: FnOnce() -> R,Expand description
Like with_r_unwind_protect_or_raise, but reports panics with a custom
[PanicSource].
Used by guarded_altrep_call so that panics inside ALTREP callbacks with
AltrepGuard::RUnwind are still attributed to PanicSource::Altrep.
Handles crate::condition::RCondition payloads:
-
RCondition::Error— routes throughraise_rust_condition_via_stopwhichRf_evalsstop(structure(..., class = c("rust_error", ...))). This gives fullrust_*class layering even in ALTREP callback context where there is no R wrapper to inspect a tagged SEXP (Approach 3 from the issue-345 plan). Customclass = "..."fromerror!()is preserved in the class vector. -
Warning,Message,Condition— convert to a plain R error with a diagnostic message.warning!()/message!()from ALTREP context cannot suspend execution for non-fatal signals; documented limitation.