Timmmm
Timmmm

Reputation: 96615

What exit code does a Rust program return if main returns an Err

In the current version of Rust (1.43) what exit code does a program produce if you return an Err from main()?

Upvotes: 0

Views: 1050

Answers (1)

Masklinn
Masklinn

Reputation: 42332

The Termination trait is used to get an exit code from whatever main returns. The existing implementations wrap libc's EXIT_SUCCESS or EXIT_FAILURE which... are implementation-defined. But on unix-like systems they're probably 0 and 1.

Upvotes: 3

Related Questions