about summary refs log tree commit diff
path: root/src/libstd/sys_common
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2020-05-18 11:11:19 +0000
committerbors <bors@rust-lang.org>2020-05-18 11:11:19 +0000
commit9e2a6a29ce82e4fc5decad86dab7911a38582438 (patch)
treee6cb48e01bb939c8962a206153f763b960099ad0 /src/libstd/sys_common
parentd4bf05693c2c16e299f1adc279b54c37a8edef27 (diff)
parent2764673dca6badb2ef89450bbdd84b19c317a9c7 (diff)
downloadrust-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_common')
-rw-r--r--src/libstd/sys_common/util.rs4
1 files changed, 1 insertions, 3 deletions
diff --git a/src/libstd/sys_common/util.rs b/src/libstd/sys_common/util.rs
index 00f7db4c037..9f7c3bd8795 100644
--- a/src/libstd/sys_common/util.rs
+++ b/src/libstd/sys_common/util.rs
@@ -16,9 +16,7 @@ pub fn dumb_print(args: fmt::Arguments<'_>) {
 
 pub fn abort(args: fmt::Arguments<'_>) -> ! {
     dumb_print(format_args!("fatal runtime error: {}\n", args));
-    unsafe {
-        crate::sys::abort_internal();
-    }
+    crate::sys::abort_internal();
 }
 
 #[allow(dead_code)] // stack overflow detection not enabled on all platforms