Skip to content

Commit 3ef3955

Browse files
committed
pal/unsupported: Implement SystemTime::{MIN, MAX}
This commit implements `SystemTime::MIN` and `SystemTime::MAX` for all unsupported platforms. Unsupported platforms store a `SystemTime` in a `Duration`, just like wasip1, sgx, and a few others, thereby implying `Duration::ZERO` and `Duration::MAX` as the respective limits.
1 parent 057ff62 commit 3ef3955

File tree

1 file changed

+6
-0
lines changed
  • library/std/src/sys/pal/unsupported

1 file changed

+6
-0
lines changed

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

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

2929
impl SystemTime {
30+
#[unstable(feature = "time_systemtime_limits", issue = "none")]
31+
pub const MAX: SystemTime = Duration::ZERO;
32+
33+
#[unstable(feature = "time_systemtime_limits", issue = "none")]
34+
pub const MIN: SystemTime = Duration::MAX;
35+
3036
pub fn now() -> SystemTime {
3137
panic!("time not implemented on this platform")
3238
}

0 commit comments

Comments
 (0)