From f90986e3a8d21d979e871c1af304ccfbe2c81093 Mon Sep 17 00:00:00 2001 From: Guillaume Gomez Date: Sat, 3 Dec 2016 15:46:28 -0800 Subject: [PATCH] Add examples for exit function --- src/libstd/process.rs | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index 9e1b57c741260..70453a74d2c9a 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -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();