]> git.lizzy.rs Git - rust.git/blobdiff - src/libstd/sys/sgx/mod.rs
SGX target: improve panic & exit handling
[rust.git] / src / libstd / sys / sgx / mod.rs
index dd6862e908e06950224afca1451053a8da18f113..f2593c35bed14c6c79103d2716e6b0a098e9627f 100644 (file)
@@ -1,13 +1,3 @@
-// Copyright 2018 The Rust Project Developers. See the COPYRIGHT
-// file at the top-level directory of this distribution and at
-// http://rust-lang.org/COPYRIGHT.
-//
-// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or
-// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license
-// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your
-// option. This file may not be copied, modified, or distributed
-// except according to those terms.
-
 //! System bindings for the Fortanix SGX platform
 //!
 //! This module contains the facade (aka platform-specific) implementations of
@@ -27,6 +17,7 @@
 pub mod cmath;
 pub mod condvar;
 pub mod env;
+pub mod ext;
 pub mod fd;
 pub mod fs;
 pub mod memchr;
@@ -134,7 +125,7 @@ pub unsafe fn strlen(mut s: *const c_char) -> usize {
 }
 
 pub unsafe fn abort_internal() -> ! {
-    abi::panic::panic_exit()
+    abi::panic::usercall_exit(true)
 }
 
 pub fn hashmap_random_keys() -> (u64, u64) {
@@ -151,3 +142,9 @@ fn rdrand64() -> u64 {
     }
     (rdrand64(), rdrand64())
 }
+
+pub use sys_common::{AsInner, FromInner, IntoInner};
+
+pub trait TryIntoInner<Inner>: Sized {
+    fn try_into_inner(self) -> Result<Inner, Self>;
+}