]> git.lizzy.rs Git - rust.git/commitdiff
Add example to std::process::abort
authorraph <rap2hpoutre@users.noreply.github.com>
Wed, 29 Mar 2017 13:59:22 +0000 (15:59 +0200)
committerGitHub <noreply@github.com>
Wed, 29 Mar 2017 13:59:22 +0000 (15:59 +0200)
src/libstd/process.rs

index d46cf7a26daf06aa5a17b0ebe5d3a724f4d88d00..32b52d1f77a01bbb885bdf337fbfd37baf75da9e 100644 (file)
@@ -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() };