Skip to main content

make_rust_condition_value

Function make_rust_condition_value 

Source
pub unsafe fn make_rust_condition_value(
    message: &str,
    kind: &str,
    class: Option<&str>,
    call: Option<SEXP>,
) -> SEXP
Expand description

Build a tagged condition value with no structured data payload.

Thin wrapper over make_rust_condition_value_with_data with data = None and at most one class. Generated code uses it for the unclassed kinds (Option::None); classed Result::Err values go through result_err_condition_value, argument-conversion failures through conversion_condition_value, a post-conversion no_na refusal through arg_check_condition_value, and the user-facing error!() / warning!() / message!() / condition!() macros (routed through crate::unwind_protect) attach their own data.

§Safety

Must be called from R’s main thread in a valid R allocation context — the body performs raw R allocation (Rf_allocVector, SET_VECTOR_ELT, SETATTRIB) which is UB off the main thread. See make_rust_condition_value_with_data for the full contract.