diff options
Diffstat (limited to 'compiler/rustc_error_codes/src/error_codes/E0061.md')
-rw-r--r-- | compiler/rustc_error_codes/src/error_codes/E0061.md | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0061.md b/compiler/rustc_error_codes/src/error_codes/E0061.md new file mode 100644 index 000000000..143251c13 --- /dev/null +++ b/compiler/rustc_error_codes/src/error_codes/E0061.md @@ -0,0 +1,23 @@ +An invalid number of arguments was passed when calling a function. + +Erroneous code example: + +```compile_fail,E0061 +fn f(u: i32) {} + +f(); // error! +``` + +The number of arguments passed to a function must match the number of arguments +specified in the function signature. + +For example, a function like: + +``` +fn f(a: u16, b: &str) {} +``` + +Must always be called with exactly two arguments, e.g., `f(2, "test")`. + +Note that Rust does not have a notion of optional function arguments or +variadic functions (except for its C-FFI). |