Skip to content

Commit a20d7be

Browse files
committed
pal/sgx: Implement SystemTime::{MIN, MAX}
This commit implements `SystemTime::MIN` and `SystemTime::MAX` for sgx. The implementation uses a `Duration` to store the Unix time, thereby implying `Duration::ZERO` and `Duration::MAX` as the limits.
1 parent 0bcba14 commit a20d7be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

library/std/src/sys/pal/sgx/time.rs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,12 @@ impl Instant {
2828
}
2929

3030
impl SystemTime {
31+
#[unstable(feature = "time_systemtime_limits", issue = "none")]
32+
pub const MAX: SystemTime = SystemTime(Duration::MAX);
33+
34+
#[unstable(feature = "time_systemtime_limits", issue = "none")]
35+
pub const MIN: SystemTime = SystemTime(Duration::ZERO);
36+
3137
pub fn now() -> SystemTime {
3238
SystemTime(usercalls::insecure_time())
3339
}

0 commit comments

Comments
 (0)