Skip to main content

check_param_preconditions

Function check_param_preconditions 

Source
pub(crate) fn check_param_preconditions(
    attrs: &ParamAttrs,
    markers: &[ParamMarker],
    param: &str,
    ty: &Type,
    method_list: bool,
) -> Result<()>
Expand description

Reject a parameter’s rank-1 precondition decision where it has nothing to act on: a match_arg / choices parameter (validated by match.arg(), never by type checks) and a type without type-derived checks (SEXP, Missing<T>, ExternalPtr<T>, &Dots, a type the check table does not know). ty is the parameter’s type with the markers peeled, which the errors point at; markers are the ones it carried. A no-op when the parameter decides nothing itself.