-
-
Notifications
You must be signed in to change notification settings - Fork 14.8k
std::time::Duration::from_secs_f64 behavior changed in 1.63.0 #100480
Copy link
Copy link
Closed
Labels
C-bugCategory: This is a bug.Category: This is a bug.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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Milestone
Metadata
Metadata
Assignees
Labels
C-bugCategory: This is a bug.Category: This is a bug.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.regression-from-stable-to-stablePerformance or correctness regression from one stable version to another.Performance or correctness regression from one stable version to another.
Type
Fields
Give feedbackNo fields configured for issues without a type.
Related release note: https://github.com/rust-lang/rust/blob/stable/RELEASES.md#libraries-3Related PR: Improve Duration::try_from_secs_f32/64 accuracy by directly processing exponent and mantissa #90247Though the PR describes the change is related to improve its truncation better, the changed behavior is rounding up which was down before.EDIT: The upper changes and issue related to 1.60. It is not related to this issue.
I want to check if this is expected change or regression.
Code
I tried this code:
I expected to see this happen: explanation
Until 1.62.1,
Instead, this happened: explanation
In 1.63.0,
Version it worked on
It most recently worked on: Until 1.62.1
Version with regression
rustc --version --verbose: