In Rust the main function is defined like this:
fn main() { }
This function does not allow for a return value though. Why would a language not
You can set the return value with std::os::set_exit_status.
std::os::set_exit_status