rust-lang / rust-lang/rust

Tracking Issue for `SystemTime::MIN` and `SystemTime::MAX`

Open
#149,067 0 comments 4 reactions 0 assignees View on GitHub

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. 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

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.