Tracking Issue for `SystemTime::MIN` and `SystemTime::MAX`
Open
Nobody has claimed this yet.
C-tracking-issue
T-libs
- Dominant language
- Rust
- Stars
- 119k
- Forks
- 16.1k
- PR merge metrics
- PR metrics pending
Description
Feature gate: #![feature(time_systemtime_limits)]
This is a tracking issue for https://github.com/rust-lang/libs-team/issues/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
- ACP: rust-lang/libs-team#692
- Implementation: #148825
- Final comment period (FCP)^1
- Stabilization PR
Unresolved Questions
- What should the bounds be on 32-bit platforms? See discussion in https://github.com/rust-lang/rust/pull/148825#discussion_r2548241009. Maybe better resolved by using 64-bit wide APIs on 32-bit platforms (such as
__clock_gettime64orclock_gettime_nsec_np)
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by reading implementation PR #148825 and the linked discussion about 32-bit platform bounds. Review the feature-gated SystemTime::MIN and SystemTime::MAX API and the stabilization requirements. Done means resolving the outstanding bounds question, completing the final comment period, and opening or supporting a stabilization PR.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- operating-systems
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 25/100