Skip to content

Commit

Permalink
Rollup merge of rust-lang#40904 - rap2hpoutre:patch-1, r=steveklabnik
Browse files Browse the repository at this point in the history
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).
  • Loading branch information
frewsxcv authored Mar 31, 2017
2 parents 5f1bb8f + 1be84ce commit fe34818
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/libstd/process.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1056,6 +1056,20 @@ 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
///
/// ```no_run
/// 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() };
Expand Down

0 comments on commit fe34818

Please sign in to comment.