diff options
| author | raph <rap2hpoutre@users.noreply.github.com> | 2017-03-29 15:59:22 +0200 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2017-03-29 15:59:22 +0200 |
| commit | 022bae8a4a9254fbdb4217e86927809f0ad996d6 (patch) | |
| tree | 6ca9500185129f4f52da76ce3fdbbc96b5814d43 /src/libstd | |
| parent | abf5592510156e08b4de3830afaabbc0b65ce054 (diff) | |
| download | rust-022bae8a4a9254fbdb4217e86927809f0ad996d6.tar.gz rust-022bae8a4a9254fbdb4217e86927809f0ad996d6.zip | |
Add example to std::process::abort
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/process.rs | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/libstd/process.rs b/src/libstd/process.rs index d46cf7a26da..32b52d1f77a 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() }; |
