From 022bae8a4a9254fbdb4217e86927809f0ad996d6 Mon Sep 17 00:00:00 2001 From: raph Date: Wed, 29 Mar 2017 15:59:22 +0200 Subject: [PATCH 1/4] Add example to std::process::abort --- src/libstd/process.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index d46cf7a26daf0..32b52d1f77a01 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -1056,6 +1056,19 @@ pub fn exit(code: i32) -> ! { /// 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; +/// +/// fn main() { +/// println!("aborting"); +/// +/// process::abort(); +/// +/// // execution never gets here +/// } +/// ``` #[stable(feature = "process_abort", since = "1.17.0")] pub fn abort() -> ! { unsafe { ::sys::abort_internal() }; From 3ac27c3e54f3f5477ea907246c872523f14ef6df Mon Sep 17 00:00:00 2001 From: raph Date: Wed, 29 Mar 2017 16:19:23 +0200 Subject: [PATCH 2/4] adding /// --- src/libstd/process.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index 32b52d1f77a01..83d34f71a70a2 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -1058,6 +1058,7 @@ pub fn exit(code: i32) -> ! { /// to run. /// /// # Examples +/// /// ``` /// use std::process; /// From 5a7e9ad64a160c9ebfb35969f2bdd1065bc154bb Mon Sep 17 00:00:00 2001 From: raph Date: Wed, 29 Mar 2017 16:30:39 +0200 Subject: [PATCH 3/4] Removing trailing spaces --- src/libstd/process.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index 83d34f71a70a2..a86dba97f7865 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -1061,12 +1061,12 @@ pub fn exit(code: i32) -> ! { /// /// ``` /// use std::process; -/// +/// /// fn main() { /// println!("aborting"); -/// +/// /// process::abort(); -/// +/// /// // execution never gets here /// } /// ``` From 1be84cee75687856c0032ad0fd5ea96945c067b7 Mon Sep 17 00:00:00 2001 From: raph Date: Thu, 30 Mar 2017 09:55:44 +0200 Subject: [PATCH 4/4] Update process.rs --- src/libstd/process.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/libstd/process.rs b/src/libstd/process.rs index a86dba97f7865..7f1a00c707c20 100644 --- a/src/libstd/process.rs +++ b/src/libstd/process.rs @@ -1059,7 +1059,7 @@ pub fn exit(code: i32) -> ! { /// /// # Examples /// -/// ``` +/// ```no_run /// use std::process; /// /// fn main() {