Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Return Termination from main instead of using std::process::exit #129

Open
rinon opened this issue Jul 17, 2019 · 1 comment
Open

Return Termination from main instead of using std::process::exit #129

rinon opened this issue Jul 17, 2019 · 1 comment
Labels
enhancement New feature or request

Comments

@rinon
Copy link
Contributor

rinon commented Jul 17, 2019

Rust 2018 allows main to return values that implement the Termination trait (i.e. that can be converted into an exit code. We should use this to exit cleanly from main instead of calling std::process::exit(), which doesn't run any global cleanup. See https://doc.rust-lang.org/edition-guide/rust-2018/error-handling-and-panics/question-mark-in-main-and-tests.html#more-details for details

@rinon rinon added the enhancement New feature or request label Jul 17, 2019
@kkysen kkysen changed the title Return Termination value from main instead of using exit Return Termination value from main instead of using std::process::exit Jun 29, 2022
@kkysen
Copy link
Contributor

kkysen commented Jun 29, 2022

impl Termination is now stabilized in Rust 1.61, so we should definitely do this.

@kkysen kkysen changed the title Return Termination value from main instead of using std::process::exit Return Termination from main instead of using std::process::exit Jun 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants