diff options
| author | bors <bors@rust-lang.org> | 2020-05-18 11:11:19 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2020-05-18 11:11:19 +0000 |
| commit | 9e2a6a29ce82e4fc5decad86dab7911a38582438 (patch) | |
| tree | e6cb48e01bb939c8962a206153f763b960099ad0 /src/libstd/sys/cloudabi | |
| parent | d4bf05693c2c16e299f1adc279b54c37a8edef27 (diff) | |
| parent | 2764673dca6badb2ef89450bbdd84b19c317a9c7 (diff) | |
| download | rust-9e2a6a29ce82e4fc5decad86dab7911a38582438.tar.gz rust-9e2a6a29ce82e4fc5decad86dab7911a38582438.zip | |
Auto merge of #72289 - RalfJung:abort_internal, r=Mark-Simulacrum
abort_internal is safe `sys::abort_internal` is stably exposed as a safe function. Forward that assumption "inwards" to the `sys` module by making the function itself safe, too. This corresponds to what https://github.com/rust-lang/rust/pull/72204 did for the intrinsic. We should probably wait until that lands because some of the intrinsic calls in this PR might then need adjustments.
Diffstat (limited to 'src/libstd/sys/cloudabi')
| -rw-r--r-- | src/libstd/sys/cloudabi/mod.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/libstd/sys/cloudabi/mod.rs b/src/libstd/sys/cloudabi/mod.rs index e5f1dd98435..dde2b21c9bc 100644 --- a/src/libstd/sys/cloudabi/mod.rs +++ b/src/libstd/sys/cloudabi/mod.rs @@ -51,8 +51,11 @@ pub fn decode_error_kind(errno: i32) -> ErrorKind { } } -pub unsafe fn abort_internal() -> ! { - core::intrinsics::abort(); +pub fn abort_internal() -> ! { + #[cfg_attr(not(bootstrap), allow(unused_unsafe))] // remove `unsafe` on bootstrap bump + unsafe { + core::intrinsics::abort(); + } } pub use libc::strlen; |
