-
-
Notifications
You must be signed in to change notification settings - Fork 14.2k
Open
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.
Description
Feature gate: #![feature(time_systemtime_limits)]
This is a tracking issue for rust-lang/libs-team#692
Public API
use std::time::{Duration, SystemTime};
// Adding the smallest possible Duration to SystemTime::MAX shall fail ...
assert!(SystemTime::MAX.checked_add(Duration::new(0, 1)).is_none());
// ... whereas subtracting it shall be fine.
assert!(SystemTime::MAX.checked_sub(Duration::new(0, 1)).is_some());
// Subtracting the smallest possible Duration from SystemTime::MIN shall fail ...
assert!(SystemTime::MIN.checked_sub(Duration::new(0, 1)).is_none());
// ... whereas adding it shall be fine.
assert!(SystemTime::MIN.checked_add(Duration::new(0, 1)).is_some());Steps / History
(Remember to update the S-tracking-* label when checking boxes.)
- ACP: ACP: Add
SystemTime::MINandSystemTime::MAXlibs-team#692 - Implementation: Add SystemTime::{MIN, MAX} #148825
- Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- What should the bounds be on 32-bit platforms? See discussion in Add SystemTime::{MIN, MAX} #148825 (comment). Maybe better resolved by using 64-bit wide APIs on 32-bit platforms (such as
__clock_gettime64orclock_gettime_nsec_np)
Footnotes
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCS-tracking-unimplementedStatus: The feature has not been implemented.Status: The feature has not been implemented.T-libs-apiRelevant to the library API team, which will review and decide on the PR/issue.Relevant to the library API team, which will review and decide on the PR/issue.