Logo

Programming-Idioms

History of Idiom 87 > diff from v8 to v9

Edit summary for version 9 by :

Version 8

2015-10-28, 02:28:20

Version 9

2015-10-29, 13:00:07

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);
Code
std::process::exit(0);
Comments bubble
"[…] no destructors on the current stack or any other thread's stack will be run."
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
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
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