]> git.proxmox.com Git - rustc.git/blob - src/librustc_error_codes/error_codes/E0580.md
New upstream version 1.41.1+dfsg1
[rustc.git] / src / librustc_error_codes / error_codes / E0580.md
1 The `main` function was incorrectly declared.
2
3 Erroneous code example:
4
5 ```compile_fail,E0580
6 fn main(x: i32) { // error: main function has wrong type
7 println!("{}", x);
8 }
9 ```
10
11 The `main` function prototype should never take arguments.
12 Example:
13
14 ```
15 fn main() {
16 // your code
17 }
18 ```
19
20 If you want to get command-line arguments, use `std::env::args`. To exit with a
21 specified exit code, use `std::process::exit`.