E0060 Variadic Function Missing Argument Fix
Written December 2, 2026 · Tested with Rust 1.99.1 · 18 min read
- The rule underneath: the named parameters are a floor, not the whole signature
- How to read the diagnostic
- The first failure: the index example
- The same error with more named parameters, through a pointer, and on a Rust-defined variadic function
Written December 2, 2026
Tested with Rust 1.99.1
What this guide is
Error E0060 means a call supplied fewer arguments than a C variadic function requires. The error codes index puts it plainly: external C functions are allowed to be variadic, but a variadic function takes a minimum number of arguments - the named parameters written before the ... - and calling it with fewer than that minimum is this error.
In the shapes probed in this guide, E0060 fires on its own for a call with no arguments to a variadic declaration with one named parameter, for calls supplying none and one of two named parameters, for a call supplying two of three named parameters, for a call through a variadic function pointer, and for a call to a variadic function defined in Rust. A second code rides along when the same program also calls a misspelled function name, which drew E0425 alongside. Neighboring shapes draw different codes instead: a wrong argument count on an ordinary, non-variadic function drew E0061, a named argument of the wrong type with the count satisfied drew E0308, and an f32 passed as a variadic argument drew E0617. At the boundary, a variadic declaration with no named parameters has a minimum of zero, and a call that supplies exactly the named count compiles and runs. This guide shows the E0060 shapes, the ride-along and neighboring shapes, the boundary, and the repairs.
Build every program in this guide with rustc --edition 2021. In the compiler transcripts, the file names are the bare names shown on the command line.
The rule underneath: the named parameters are a floor, not the whole signature
A trailing ... in an extern "C" declaration means the caller may pass extra arguments after the named ones. It does not make the named ones optional. The declaration fn printf(_: *const c_char, ...) -> c_int; promises C a format pointer on every call; the variadic part is only everything after it. A call that does not supply the format pointer is not a short variadic call - it is a call missing a required argument, and the compiler refuses it with E0060 before any code runs.
So the minimum for a variadic call is exactly the count of named parameters in the declaration, in the probed shapes: one for printf as declared in the index example, two for a declaration with two named parameters, three for a declaration with three. Anything at or above the floor is accepted as far as the count goes - the extra arguments are the variadic part. Anything below it is E0060, and the only honest repair is to supply the missing named arguments; there is no way to declare the call site exempt.
How to read the diagnostic
The E0060 header states both counts: "this function takes at least 1 argument but 0 arguments were supplied", in the index shape. The word "at least" is the variadic marker - an ordinary function with a wrong count draws a header without it, as the neighboring shapes below show. The span underlines the function name in the call, and the dashes after it name each missing argument: "argument #1 of type *const i8 is missing" for one, "two arguments of type *const i8 and i32 are missing" for two, in the probed shapes. A note points back to the declaration - "function defined here" - and a help block proposes the call with placeholders for the missing arguments: "provide the argument", with the suggested call written out.
The count follows the call sites, in the probed shapes: a program with one short call drew exactly one error[E0060], and a program with the same short call written twice drew exactly two, one per call, ending with "aborting due to 2 previous errors". The error also fires wherever the call sits - in main, in a helper function, and when the call's return value is used - in the probed shapes; none of those change the code.
One probed shape carried an extra fact inside the E0060 block without a second code: when the one supplied argument was also of the wrong type, the E0060 block added a note - "expected *const i8, found usize" - under the missing-argument span, and no E0308 appeared. Read the whole block before fixing: supplying the missing argument clears the E0060, and the note tells you the supplied one needs its own fix.
The first failure: the index example
The index's erroneous example, verbatim:
#![allow(unused)]
fn main() {
use std::os::raw::{c_char, c_int};
extern "C" {
fn printf(_: *const c_char, ...) -> c_int;
}
unsafe { printf(); }
}
error[E0060]: this function takes at least 1 argument but 0 arguments were supplied
--> fail_index.rs:7:10
|
7 | unsafe { printf(); }
| ^^^^^^-- argument #1 of type `*const i8` is missing
|
note: function defined here
--> fail_index.rs:5:8
|
5 | fn printf(_: *const c_char, ...) -> c_int;
| ^^^^^^ -
help: provide the argument
|
7 | unsafe { printf(/* *const i8 */); }
| +++++++++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0060`.
Exactly one E0060, and no other error code. The declaration is legal - it is the same printf declaration the index's own allowed example uses - and the call is unsafe-wrapped as it must be. The only thing wrong is the empty argument list: the ... covers arguments after the format pointer, not the format pointer itself.
The same error with more named parameters, through a pointer, and on a Rust-defined variadic function
The floor rises with the declaration. A variadic declaration with two named parameters, called with one of them, drew exactly one E0060 in the probed shape, and the header counted both sides - "takes at least 2 arguments but 1 argument was supplied":
error[E0060]: this function takes at least 2 arguments but 1 argument was supplied
--> fail_two_named_one.rs:6:14
|
6 | unsafe { log_line(c"count".as_ptr()); }
| ^^^^^^^^------------------- argument #2 of type `i32` is missing
|
note: function defined here
--> fail_two_named_one.rs:3:8
|
3 | fn log_line(_: *const c_char, _: c_int, ...) -> c_int;
| ^^^^^^^^ -
help: provide the argument
|
6 | unsafe { log_line(c"count".as_ptr(), /* i32 */); }
| +++++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0060`.
The same declaration called with no arguments drew exactly one E0060 in the probed shape, with the header reading "takes at least 2 arguments but 0 arguments were supplied" and the span naming both missing arguments. A declaration with three named parameters - the real C snprintf, with its buffer, size, and format parameters - called with two drew exactly one E0060 in the probed shape:
error[E0060]: this function takes at least 3 arguments but 2 arguments were supplied
--> fail_snprintf_two_of_three.rs:7:14
|
7 | unsafe { snprintf(buf.as_mut_ptr(), buf.len()); }
| ^^^^^^^^----------------------------- argument #3 of type `*const i8` is missing
|
note: function defined here
--> fail_snprintf_two_of_three.rs:3:8
|
3 | fn snprintf(_: *mut c_char, _: usize, _: *const c_char, ...) -> c_int;
| ^^^^^^^^ -
help: provide the argument
|
7 | unsafe { snprintf(buf.as_mut_ptr(), buf.len(), /* *const i8 */); }
| +++++++++++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0060`.
The name on the declaration does not matter. The index shape with the function renamed to my_printf drew exactly one E0060 in the probed shape, with the same header - the error follows the declaration's shape, not any list of known C functions. Neither does the call form: calling through a function pointer typed unsafe extern "C" fn(*const c_char, ...) -> c_int with no arguments drew exactly one E0060 in the probed shape, with the span on the pointer's name and the same help block, though no "function defined here" note - a pointer has no declaration site to point back to.
A variadic function defined in Rust is held to the same floor. An unsafe extern "C" fn emit(first: i32, _: ...) -> i32 defined in the program, called with no arguments, drew exactly one E0060 in the probed shape:
error[E0060]: this function takes at least 1 argument but 0 arguments were supplied
--> fail_rust_defined.rs:3:14
|
3 | unsafe { emit(); }
| ^^^^-- argument #1 of type `i32` is missing
|
note: function defined here
--> fail_rust_defined.rs:1:22
|
1 | unsafe extern "C" fn emit(first: i32, _: ...) -> i32 { first }
| ^^^^ ----------
help: provide the argument
|
3 | unsafe { emit(/* i32 */); }
| +++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0060`.
The shape where a second code rides along
E0060 is reported per call site, and other errors in the same program are reported alongside it. A program that made the index's short printf() call and then called a misspelled printff with a correct argument drew E0060 and E0425 together in the probed shape, ending with "aborting due to 2 previous errors":
error[E0060]: this function takes at least 1 argument but 0 arguments were supplied
--> ride_unknown_function.rs:6:14
|
6 | unsafe { printf(); }
| ^^^^^^-- argument #1 of type `*const i8` is missing
|
note: function defined here
--> ride_unknown_function.rs:3:8
|
3 | fn printf(_: *const c_char, ...) -> c_int;
| ^^^^^^ -
help: provide the argument
|
6 | unsafe { printf(/* *const i8 */); }
| +++++++++++++++
error[E0425]: cannot find function `printff` in this scope
--> ride_unknown_function.rs:7:14
|
3 | fn printf(_: *const c_char, ...) -> c_int;
| ------------------------------------------ similarly named function `printf` defined here
...
7 | unsafe { printff(c"x".as_ptr()); }
| ^^^^^^^
|
help: a function with a similar name exists
|
7 - unsafe { printff(c"x".as_ptr()); }
7 + unsafe { printf(c"x".as_ptr()); }
|
error: aborting due to 2 previous errors
Some errors have detailed explanations: E0060, E0425.
For more information about an error, try `rustc --explain E0060`.
Supplying the missing argument clears the E0060 in that shape and leaves the E0425 standing - the misspelled name is a separate problem that happens to share the output.
The shapes that are not this error
A wrong argument count on an ordinary function is the closest neighbor, and it is a different code. Calling a plain Rust function add(a: i32, b: i32) with no arguments drew exactly one E0061 in the probed shape - the header reads "this function takes 2 arguments but 0 arguments were supplied", with no "at least", because an ordinary function's count is exact rather than a floor:
error[E0061]: this function takes 2 arguments but 0 arguments were supplied
--> neighbour_nonvariadic_too_few.rs:3:20
|
3 | println!("{}", add());
| ^^^-- two arguments of type `i32` and `i32` are missing
|
note: function defined here
--> neighbour_nonvariadic_too_few.rs:1:4
|
1 | fn add(a: i32, b: i32) -> i32 { a + b }
| ^^^ ------ ------
help: provide the arguments
|
3 | println!("{}", add(/* i32 */, /* i32 */));
| ++++++++++++++++++++
error: aborting due to 1 previous error
For more information about this error, try `rustc --explain E0061`.
The same ordinary function called with three arguments also drew exactly one E0061 in the probed shape - "takes 2 arguments but 3 arguments were supplied", with a help block proposing the extra argument's removal. Too many arguments is never E0060: a variadic call accepts any count at or above its floor, so an excess has nothing to offend against, and a non-variadic excess is E0061's shape. If the header says "at least", the function is variadic and the call is short; if it does not, the function is ordinary and the count is simply wrong.
A named argument of the wrong type, with the count satisfied, is also not this error. Calling printf with a single integer argument - the count meets the floor of one - drew exactly one E0308 in the probed shape, "mismatched types", with the span on the argument and the expected and found types. E0060 counts arguments; it does not grade them. A call can be at the floor and still wrong, and that wrongness is reported under its own code.
Passing the wrong type as a variadic argument is a third neighbor. Calling printf with a format and an f32 as the extra argument drew exactly one E0617 in the probed shape, "can't pass f32 to variadic function", with a help block proposing a cast to c_double - while the same call with an f64 compiled and ran, printing 1.000000. The count was satisfied in both shapes; only the argument's type differed.
The boundary: a minimum of zero, and the exact floor
The floor is the named count, and it can be zero. A variadic declaration with no named parameters at all - fn anything(...); in an extern "C" block - compiled in the probed shape, and a call to it with no arguments passed the compiler's argument check: in the probed shape that call failed only at link time, because the invented name anything is not a real C symbol. No E0060 appeared - with no named parameters, there is nothing for a zero-argument call to miss. Declarations of real C functions always name at least one parameter in practice, so this boundary is a statement about the rule rather than a shape to copy: count the named parameters in the declaration you have, and that count is the minimum.
At the floor itself, calls run. printf called with exactly its one named argument, and snprintf called with exactly its three, each compiled and ran in the probed shapes, as the repairs below show. The line is exact: one below the floor is E0060, at the floor is a working call.
Related guides
For a wrong argument count on an ordinary function - too few or too many - the neighboring code is E0061. For an argument whose type does not match its parameter, the neighboring code is E0308. For an invalid type passed as a variadic argument, the neighboring code is E0617, and for a variadic parameter list declared on a non-C ABI, check E0045's shape before reaching for this guide's fix.
The repairs
Every repair below starts from the same observation: the call is below the declaration's floor, so the missing named arguments have to be supplied. There is no repair that lowers the floor from the call site.
Supply the one required argument. Giving the index call its format pointer - the exact call the index's own allowed example uses - compiled and ran in the probed shape, printing test:
use std::os::raw::{c_char, c_int};
extern "C" {
fn printf(_: *const c_char, ...) -> c_int;
}
fn main() {
unsafe { printf(c"test\n".as_ptr()); }
}
test
Supply the named arguments and let the extras follow. The index's remaining allowed calls compiled and ran together in the probed shape, printing number = 3 and then 10, 5 - each call supplies the format pointer first, and the values after it are the variadic part the ... exists for:
number = 3
10, 5
Supply every named argument of a multi-parameter declaration. snprintf called with its buffer, its size, and its format - exactly the three named parameters, no extras - compiled and ran in the probed shape, printing wrote 2:
use std::os::raw::{c_char, c_int};
extern "C" {
fn snprintf(_: *mut c_char, _: usize, _: *const c_char, ...) -> c_int;
}
fn main() {
let mut buf = [0 as c_char; 32];
let n = unsafe { snprintf(buf.as_mut_ptr(), buf.len(), c"hi".as_ptr()) };
println!("wrote {n}");
}
wrote 2
Adding one variadic extra on top of the full named set also compiled and ran in the probed shape, printing wrote 3 text v=9 - the formatted value landed in the buffer, which is the call working as C expects once the floor is met.
Pass the format through a variable when the call site is what went wrong. Binding the format string to a variable first and passing the variable compiled and ran in the probed shape, printing hello - a useful shape when the empty call came from a refactor that dropped an argument list: the named argument is visible at the call again, and the count is easy to check against the declaration.
Call a Rust-defined variadic function with its named argument. The emit definition from the failing shapes above, called with its one named argument, compiled and ran in the probed shape, printing got 5:
got 5
Fixes in reach order
First, count the named parameters in the declaration - the parameters before the .... That count is the floor, in the probed shapes: one for the index's printf, two and three for the wider declarations probed. The E0060 header states the same two numbers, so check the call against either.
Second, supply the missing named arguments, in declaration order. That is the whole repair for every probed pure E0060 shape: the format pointer for printf, the buffer, size, and format for snprintf, the one named argument for a Rust-defined variadic function.
Third, read the rest of the output before stopping. In the probed shapes, an E0425 rode along when a second call used a misspelled name, and a type note rode inside the E0060 block when a supplied argument was also of the wrong type - a supplied count clears the E0060 and neither of those.
Fourth, if the header does not say "at least", the function is not variadic and the code is not this one: in the probed shapes, an ordinary function with a wrong count drew E0061 for both too few and too many arguments, a wrongly typed argument at the floor drew E0308, and an f32 among the variadic extras drew E0617. Fix those under their own codes.
Decision summary
E0060 fired on its own in the probed shapes for a call with no arguments to a one-named-parameter variadic declaration (the index example, exactly one E0060), for a renamed copy of the same declaration called the same way (exactly one E0060), for the call placed in a helper function and for the call with its return value used (exactly one E0060 each), for calls supplying none of two and one of two named parameters (exactly one E0060 each, with the header counting the floor and the supplied count), for a call supplying two of three named parameters on two different declarations (exactly one E0060 each), for a call through a variadic function pointer with no arguments (exactly one E0060), for a call to a Rust-defined variadic function with no arguments (exactly one E0060), and twice in one program that wrote the short call twice (exactly two E0060 errors, one per call). It rode along with E0425 in a program that also called a misspelled function name. It did not fire for a variadic declaration with no named parameters, whose zero-argument call passed the argument check and failed only at link time for an invented symbol, for an ordinary function called with too few or too many arguments (E0061 in both shapes), for a call at the floor with a wrongly typed argument (E0308), or for an f32 passed as a variadic extra (E0617, where the same call with an f64 compiled and ran). The repairs that compiled and ran were supplying the one required argument to printf (printing test), supplying the format plus variadic extras (printing number = 3 and 10, 5), supplying all three named arguments to snprintf (printing wrote 2), adding an extra on top of the full named set (printing wrote 3 text v=9), passing the format through a variable (printing hello), and calling a Rust-defined variadic function with its named argument (printing got 5).
Checklist
- E0060 is a floor problem, in the probed shapes: the
...makes extra arguments allowed, never the named ones optional. - The floor is the named count, in the probed shapes: one named parameter meant at least 1, two meant at least 2, three meant at least 3, and a declaration with no named parameters had a minimum of zero.
- The header is the tell, in the probed shapes: "takes at least" marks a variadic floor and E0060, while a plain "takes N arguments" marks an ordinary function and E0061.
- The error count follows the call sites, in the probed shapes: one short call drew one E0060, and the same call written twice drew two.
- The declaration's name and the call's form do not matter, in the probed shapes: a renamed declaration, a call through a function pointer, and a Rust-defined variadic function all drew the same code.
- A second fact can share the output, in the probed shapes: an E0425 rode along for a misspelled second call, and a type note rode inside the E0060 block for a wrongly typed supplied argument - read the whole output before fixing.
- At the floor, the call runs, in the probed shapes: exactly the named count compiled and ran for both
printfandsnprintf, and every argument above the floor was accepted as the variadic part.
Sources
- Rust error codes index, E0060 - external C functions are allowed to be variadic, but a variadic function takes a minimum number of arguments; the erroneous example declares C's
printfwith one named parameter and calls it with none, and the allowed uses supply the format argument, with and without further variadic arguments. - Rust error codes index, E0061 - an invalid number of arguments was passed when calling a function, and the number passed must match the number specified in the signature; the neighboring code drawn in the probed shapes by an ordinary function called with too few and with too many arguments.
- Rust error codes index, E0308 - the expected type did not match the received type, including when calling a function and passing an argument of a different type than the declaration specifies; the neighboring code drawn in the probed shape by a call at the floor with a wrongly typed argument.
- Rust error codes index, E0617 - an invalid type of variable was passed into a variadic function, and certain types must be cast before passing; the neighboring code drawn in the probed shape by passing an
f32as a variadic argument. - Rust error codes index, E0425 - an unresolved name was used; the neighboring code drawn in the probed shape alongside E0060 by a call to a misspelled function name.
Keep Exploring
The full Rust hub \u2014 ownership, structs and enums, async, and measured comparisons.
Every guide on the site in one list, grouped by topic.
Every browser-only checker and verifier on the site.
The C++, Python, Sysadmin, Rust, Go, and TypeScript hubs.