compiler/rustc_error_codes/src/error_codes/E0580.md MARKDOWN 22 lines View on github.com → Search inside
1The `main` function was incorrectly declared.23Erroneous code example:45```compile_fail,E05806fn main(x: i32) { // error: main function has wrong type7    println!("{}", x);8}9```1011The `main` function prototype should never take arguments.12Example:1314```15fn main() {16    // your code17}18```1920If you want to get command-line arguments, use `std::env::args`. To exit with a21specified exit code, use `std::process::exit`.

Findings

✓ No findings reported for this file.

Get this view in your editor

Same data, no extra tab — call code_get_file + code_get_findings over MCP from Claude/Cursor/Copilot.