-
-
Notifications
You must be signed in to change notification settings - Fork 86
Open
Labels
breaking changeIssues that require a breaking change for resolution.Issues that require a breaking change for resolution.bugSomething isn't workingSomething isn't working
Description
Specifically, here is the current impl:
Lines 2815 to 2831 in 42d83ff
| #[cfg(feature = "std")] | |
| impl From<Timestamp> for std::time::SystemTime { | |
| #[inline] | |
| fn from(time: Timestamp) -> std::time::SystemTime { | |
| let unix_epoch = std::time::SystemTime::UNIX_EPOCH; | |
| let sdur = time.as_duration(); | |
| let dur = sdur.unsigned_abs(); | |
| // These are guaranteed to succeed because we assume that SystemTime | |
| // uses at least 64 bits for the time, and our durations are capped via | |
| // the range on UnixSeconds. | |
| if sdur.is_negative() { | |
| unix_epoch.checked_sub(dur).expect("duration too big (negative)") | |
| } else { | |
| unix_epoch.checked_add(dur).expect("duration too big (positive)") | |
| } | |
| } | |
| } |
It specifically notes that we assume a SystemTime always uses 64 bits. But this is not a documented guarantee. And indeed, it turns out it's not always true: rust-lang/rust#150505
This is a breaking change, so it will need to be part of the Jiff 1.0 release.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
breaking changeIssues that require a breaking change for resolution.Issues that require a breaking change for resolution.bugSomething isn't workingSomething isn't working