Skip to main content

check_call

Function check_call 

Source
pub fn check_call(
    ctor: Constructor,
    args: &[ArgKind],
    span: Span,
) -> Vec<ValidationError>
Expand description

Check a constructor call against §7.5’s shape for that constructor — before anything is built.

Returns every problem found; an empty vector means the argument list has exactly the shape the constructor’s builder expects, so the builder has nothing left to drop. Each constructor gets its own ArgShape arm, and each argument is checked in place rather than only counted: choice(int) (a positional in a named-only constructor) and sep(int, int) (a parser where a separator belongs) both have the right arity and the wrong arguments.