Skip to content

Commit

Permalink
Rollup merge of rust-lang#38151 - GuillaumeGomez:exit-examples, r=fre…
Browse files Browse the repository at this point in the history
…wsxcv

Add examples for exit function

r? @frewsxcv
  • Loading branch information
GuillaumeGomez authored Dec 7, 2016
2 parents ff8faed + f90986e commit 99d9be9
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions src/libstd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -827,6 +827,14 @@ impl Child {
/// will be run. If a clean shutdown is needed it is recommended to only call
/// this function at a known point where there are no more destructors left
/// to run.
///
/// # Examples
///
/// ```
/// use std::process;
///
/// process::exit(0);
/// ```
#[stable(feature = "rust1", since = "1.0.0")]
pub fn exit(code: i32) -> ! {
::sys_common::cleanup();
Expand Down

0 comments on commit 99d9be9

Please sign in to comment.