E0580 - Error codes index
Description: Book listing all Rust error codes

## Keyboard shortcuts

Press `←` or `→` to navigate between chapters

Press `S` or `/` to search in the book

Press `?` to show this help

Press `Esc` to hide this help

# Error code E0580

The `main` function was incorrectly declared.

Erroneous code example:

    fn main(x: i32) { // error: main function has wrong type
        println!("{}", x);
    }

The `main` function prototype should never take arguments. Example:

    fn main() {
        // your code
    }

If you want to get command-line arguments, use `std::env::args`. To exit with a specified exit code, use `std::process::exit`.