From 99fbd1bf110c1e62c0c22a0e2232bec4bf9fdd89 Mon Sep 17 00:00:00 2001 From: Vardhan Thigle Date: Wed, 9 Jan 2019 13:53:46 +0530 Subject: [PATCH] Fix breakage from #56988 and workaround for #57569 --- src/libstd/sys/sgx/time.rs | 8 ++++++++ src/libstd/sys/sgx/waitqueue.rs | 1 + 2 files changed, 9 insertions(+) diff --git a/src/libstd/sys/sgx/time.rs b/src/libstd/sys/sgx/time.rs index 10fe72d5f68..407fe72b0e6 100644 --- a/src/libstd/sys/sgx/time.rs +++ b/src/libstd/sys/sgx/time.rs @@ -25,6 +25,14 @@ impl Instant { pub fn checked_sub_duration(&self, other: &Duration) -> Option { Some(Instant(self.0.checked_sub(*other)?)) } + + pub fn actually_monotonic() -> bool { + false + } + + pub const fn zero() -> Instant { + Instant(Duration::from_secs(0)) + } } impl SystemTime { diff --git a/src/libstd/sys/sgx/waitqueue.rs b/src/libstd/sys/sgx/waitqueue.rs index a4738208778..51c00a1433e 100644 --- a/src/libstd/sys/sgx/waitqueue.rs +++ b/src/libstd/sys/sgx/waitqueue.rs @@ -456,6 +456,7 @@ mod spin_mutex { } } + /// Lock the Mutex or return false. pub macro try_lock_or_false { ($e:expr) => { if let Some(v) = $e.try_lock() {