E0207: Wrong argument count
| Code | Category | Stability |
|---|---|---|
E0207 | Semantic | Permanent |
Explanation
A call-like construct supplied the wrong number of values or bindings. This applies to function and built-in calls, enum tuple-variant construction (including a payload variant used as a bare value), and enum payload patterns with an explicit binding list.
Likely cause
A function or built-in call has a missing or extra argument; an enum value supplies the wrong number of payload values; a payload-carrying variant was used without constructing its payload; or a match pattern's parenthesized bindings do not match the variant's payload arity.
Examples
Missing call argument
fn identity(value: i32) -> i32 { value }
fn main() -> i32 {
identity()
}
Supply every argument
fn identity(value: i32) -> i32 { value }
fn main() -> i32 {
identity(42)
}