diff options
| author | bors <bors@rust-lang.org> | 2020-05-17 12:49:01 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-05-17 12:49:01 +0000 |
| commit | 34cce58d81f006a5406fcae918db4492e6cf2784 (patch) | |
| tree | 963b133e4a094980ea9c302075c7b9a8e13d3ca7 /src/libstd/sync | |
| parent | 7faeae0d385730e712634fb2af331ea0140771b4 (diff) | |
| parent | 5980d972d1911225e38e98fe81974973349793a0 (diff) | |
| download | rust-34cce58d81f006a5406fcae918db4492e6cf2784.tar.gz rust-34cce58d81f006a5406fcae918db4492e6cf2784.zip | |
Auto merge of #72204 - RalfJung:abort, r=Mark-Simulacrum
make abort intrinsic safe, and correct its documentation Turns out `std::process::abort` is not the same as the intrinsic, the comment was just wrong. Quoting from the unix implementation: ``` // On Unix-like platforms, libc::abort will unregister signal handlers // including the SIGABRT handler, preventing the abort from being blocked, and // fclose streams, with the side effect of flushing them so libc buffered // output will be printed. Additionally the shell will generally print a more // understandable error message like "Abort trap" rather than "Illegal // instruction" that intrinsics::abort would cause, as intrinsics::abort is // implemented as an illegal instruction. ```
Diffstat (limited to 'src/libstd/sync')
| -rw-r--r-- | src/libstd/sync/mpsc/shared.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/mpsc/sync.rs | 2 |
2 files changed, 4 insertions, 0 deletions
diff --git a/src/libstd/sync/mpsc/shared.rs b/src/libstd/sync/mpsc/shared.rs index fd9d61e99c2..d1a46c51757 100644 --- a/src/libstd/sync/mpsc/shared.rs +++ b/src/libstd/sync/mpsc/shared.rs @@ -354,6 +354,8 @@ impl<T> Packet<T> { // See comments on Arc::clone() on why we do this (for `mem::forget`). if old_count > MAX_REFCOUNT { + // remove `unsafe` on bootstrap bump + #[cfg_attr(not(bootstrap), allow(unused_unsafe))] unsafe { abort(); } diff --git a/src/libstd/sync/mpsc/sync.rs b/src/libstd/sync/mpsc/sync.rs index 79123903e92..603764922c5 100644 --- a/src/libstd/sync/mpsc/sync.rs +++ b/src/libstd/sync/mpsc/sync.rs @@ -358,6 +358,8 @@ impl<T> Packet<T> { // See comments on Arc::clone() on why we do this (for `mem::forget`). if old_count > MAX_REFCOUNT { + // remove `unsafe` on bootstrap bump + #[cfg_attr(not(bootstrap), allow(unused_unsafe))] unsafe { abort(); } |
