Logo

Programming-Idioms

History of Idiom 87 > diff from v2 to v3

Edit summary for version 3 by :

Version 2

2015-09-13, 11:17:55

Version 3

2015-09-14, 19:08:53

Idiom #87 Stop program

Exit immediatly.
If some extra cleanup work is executed by the program runtime (not by the OS itself), describe it.

Idiom #87 Stop program

Exit immediatly.
If some extra cleanup work is executed by the program runtime (not by the OS itself), describe it.

Code
std::process::exit(0);
Comments bubble
"[…] no destructors on the current stack or any other thread's stack will be run."
Doc URL
http://doc.rust-lang.org/std/process/fn.exit.html
Demo URL
https://play.rust-lang.org/?code=fn%20main()%20%7B%0A%20%20%20%20std%3A%3Aprocess%3A%3Aexit(1)%3B%0A%20%20%20%20println!(%2242%22)%3B%0A%7D&version=stable