Skip to content

Commit fe34818

Browse files
authored
Rollup merge of rust-lang#40904 - rap2hpoutre:patch-1, r=steveklabnik
Add example to std::process::abort This is a first step in order to complete this issue: rust-lang#29370 I submitted this PR with the help of @steveklabnik More info here: rust-lang#29370 (comment) It's my first PR on Rust, I'm learning how to contribute: Should I ping someone? I will post another PR with a more complicated example soon, I prefer send it separately (cause maybe I made some mistakes).
2 parents 5f1bb8f + 1be84ce commit fe34818

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

src/libstd/process.rs

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,20 @@ pub fn exit(code: i32) -> ! {
10561056
/// will be run. If a clean shutdown is needed it is recommended to only call
10571057
/// this function at a known point where there are no more destructors left
10581058
/// to run.
1059+
///
1060+
/// # Examples
1061+
///
1062+
/// ```no_run
1063+
/// use std::process;
1064+
///
1065+
/// fn main() {
1066+
/// println!("aborting");
1067+
///
1068+
/// process::abort();
1069+
///
1070+
/// // execution never gets here
1071+
/// }
1072+
/// ```
10591073
#[stable(feature = "process_abort", since = "1.17.0")]
10601074
pub fn abort() -> ! {
10611075
unsafe { ::sys::abort_internal() };

0 commit comments

Comments
 (0)