Skip to main content

validate_per_param_attr_conflicts

Function validate_per_param_attr_conflicts 

Source
pub(crate) fn validate_per_param_attr_conflicts(
    attr: &PerParamMiniextendrAttr,
    param_name: &str,
    is_dots: bool,
    span: Span,
) -> Result<()>
Expand description

Validate per-parameter attribute conflicts.

Returns Err if:

  • coerce + match_arg on the same parameter
  • coerce + choices(...) on the same parameter
  • choices(...) + explicit default on the same parameter
  • match_arg + choices(...) on the same parameter (two sources for one choice list; the match_arg placeholder would shadow the literal list and, with no MatchArg entry to resolve it, dangle in the R formals)
  • no_default on a parameter that is neither match_arg nor choices, or together with default (#1828)
  • default or formal on a &Dots parameter

The type-dependent checks of a choice parameter live in classify_choice_param, shared with the method paths.