about summary refs log tree commit diff
path: root/src/libstd
diff options
context:
space:
mode:
authorraph <rap2hpoutre@users.noreply.github.com>2017-03-29 15:59:22 +0200
committerGitHub <noreply@github.com>2017-03-29 15:59:22 +0200
commit022bae8a4a9254fbdb4217e86927809f0ad996d6 (patch)
tree6ca9500185129f4f52da76ce3fdbbc96b5814d43 /src/libstd
parentabf5592510156e08b4de3830afaabbc0b65ce054 (diff)
downloadrust-022bae8a4a9254fbdb4217e86927809f0ad996d6.tar.gz
rust-022bae8a4a9254fbdb4217e86927809f0ad996d6.zip
Add example to std::process::abort
Diffstat (limited to 'src/libstd')
-rw-r--r--src/libstd/process.rs13
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() };