Skip to content

the minimum possible value of SystemTime has been reduced on nightly on Windows #150505

@martintmk

Description

@martintmk

I am trying to convert the jiff's Timestamp::MIN value to SystemTime. While this works well on version 1.92, it fails on nightly-2025-10-18 build.

I tried this code:

use std::time::{Duration, SystemTime};

fn main() {
    // Alligned with jiff's Timestamp::MIN that is around 12000 years ago
    // https://github.com/BurntSushi/jiff/blob/42d83ff42a42b1cb5ff0be6f56818d4e6c13c5f5/src/timestamp.rs#L337
    let duration = Duration::from_secs(377_705_023_201);
    let epoch = SystemTime::UNIX_EPOCH;

    epoch.checked_sub(duration).unwrap();
}

I expected the above example to pass but instead, it panics with the following message:

thread 'main' (26540) panicked at src\main.rs:9:33:
called `Option::unwrap()` on a `None` value

Meta

rustc 1.94.0-nightly (56f24e00c 2025-12-29)
binary: rustc
commit-hash: 56f24e00c62ec2db9a8b407e7aef532caaf71062
commit-date: 2025-12-29
host: x86_64-pc-windows-msvc
release: 1.94.0-nightly
LLVM version: 21.1.8
Backtrace

thread 'main' (25348) panicked at src\main.rs:9:33:
called `Option::unwrap()` on a `None` value
stack backtrace:
   0: std::panicking::panic_handler
             at /rustc/dac38bd5539ee944505344739de3d33f03259109/library\std\src\panicking.rs:689
   1: core::panicking::panic_fmt
             at /rustc/dac38bd5539ee944505344739de3d33f03259109/library\core\src\panicking.rs:80
   2: core::panicking::panic
             at /rustc/dac38bd5539ee944505344739de3d33f03259109/library\core\src\panicking.rs:150
   3: core::option::unwrap_failed
             at /rustc/dac38bd5539ee944505344739de3d33f03259109/library\core\src\option.rs:2199
   4: enum2$<core::option::Option<std::time::SystemTime> >::unwrap
             at D:\.msrustup\packages\nightly.rust.tools.nightly-llvm-x86_64-pc-windows-msvc.1.94.0-ms-20251229.10014\tools\lib\rustlib\src\rust\library\core\src\option.rs:1016
   5: system_time_bug::main
             at .\src\main.rs:9
   6: core::ops::function::FnOnce::call_once<void (*)(),tuple$<> >
             at D:\.msrustup\packages\nightly.rust.tools.nightly-llvm-x86_64-pc-windows-msvc.1.94.0-ms-20251229.10014\tools\lib\rustlib\src\rust\library\core\src\ops\function.rs:250

Metadata

Metadata

Assignees

No one assigned

    Labels

    C-bugCategory: This is a bug.E-needs-bisectionCall for participation: This issue needs bisection: https://github.com/rust-lang/cargo-bisect-rustcI-prioritizeIssue: Indicates that prioritization has been requested for this issue.O-windowsOperating system: WindowsT-libsRelevant to the library team, which will review and decide on the PR/issue.needs-triageThis issue may need triage. Remove it if it has been sufficiently triaged.regression-from-stable-to-nightlyPerformance or correctness regression from stable to nightly.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions