Skip to content

Instantly share code, notes, and snippets.

@FauxFaux
Created October 13, 2019 09:50
Show Gist options
  • Save FauxFaux/16a62883dea9a5f7e0f33486cdf75c06 to your computer and use it in GitHub Desktop.
Save FauxFaux/16a62883dea9a5f7e0f33486cdf75c06 to your computer and use it in GitHub Desktop.
#![feature(process_exitcode_placeholder)]
#![feature(never_type)]
use std::process::ExitCode;
fn app() -> Result<!, ()> {
Err(())
}
fn main() -> ExitCode {
if app().is_err() {
ExitCode::FAILURE
} else {
ExitCode::SUCCESS
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment