The main
function was incorrectly declared.
Erroneous code example:
fn main(x: i32) { // error: main function has wrong type
println!("{}", x);
}
RunThe main
function prototype should never take arguments.
Example:
fn main() {
// your code
}
RunIf you want to get command-line arguments, use std::env::args
. To exit with a
specified exit code, use std::process::exit
.