diff options
| author | Jethro Beekman <jethro@fortanix.com> | 2019-02-17 15:31:46 +0530 |
|---|---|---|
| committer | Jethro Beekman <jethro@fortanix.com> | 2019-04-01 12:24:46 -0700 |
| commit | 6d96c8979d37dd137d29a992fc9b962ebe089aaf (patch) | |
| tree | 0972344239ea49d311c352d4ef775c1d0be05059 /src/libstd/sys_common | |
| parent | eab3eb38df8dca99110b6149b3a15deeb4ef0413 (diff) | |
| download | rust-6d96c8979d37dd137d29a992fc9b962ebe089aaf.tar.gz rust-6d96c8979d37dd137d29a992fc9b962ebe089aaf.zip | |
SGX target: convert a bunch of panics to aborts
Diffstat (limited to 'src/libstd/sys_common')
| -rw-r--r-- | src/libstd/sys_common/mod.rs | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/libstd/sys_common/mod.rs b/src/libstd/sys_common/mod.rs index 883ab34f07c..4c64e9f3afb 100644 --- a/src/libstd/sys_common/mod.rs +++ b/src/libstd/sys_common/mod.rs @@ -28,6 +28,15 @@ macro_rules! rtassert { }) } +#[allow(unused_macros)] // not used on all platforms +macro_rules! rtunwrap { + ($ok:ident, $e:expr) => (if let $ok(v) = $e { + v + } else { + rtabort!(concat!("unwrap failed: ", stringify!($e))); + }) +} + pub mod alloc; pub mod at_exit_imp; #[cfg(feature = "backtrace")] |
