]> git.lizzy.rs Git - rust.git/blob - compiler/rustc_error_codes/src/error_codes/E0061.md
docs: revert removal of `E0729`
[rust.git] / compiler / rustc_error_codes / src / error_codes / E0061.md
1 An invalid number of arguments was passed when calling a function.
2
3 Erroneous code example:
4
5 ```compile_fail,E0061
6 fn f(u: i32) {}
7
8 f(); // error!
9 ```
10
11 The number of arguments passed to a function must match the number of arguments
12 specified in the function signature.
13
14 For example, a function like:
15
16 ```
17 fn f(a: u16, b: &str) {}
18 ```
19
20 Must always be called with exactly two arguments, e.g., `f(2, "test")`.
21
22 Note that Rust does not have a notion of optional function arguments or
23 variadic functions (except for its C-FFI).