Implementation of try_from_{nanos_u128,mins,hours,days,weeks}#153683
Implementation of try_from_{nanos_u128,mins,hours,days,weeks}#153683Zorbatron wants to merge 3 commits intorust-lang:mainfrom
try_from_{nanos_u128,mins,hours,days,weeks}#153683Conversation
|
r? @scottmcm rustbot has assigned @scottmcm. Use Why was this reviewer chosen?The reviewer was selected based on:
|
This comment has been minimized.
This comment has been minimized.
…::error::Error` on `DurationConversionError`
d8bc8ed to
e0982d7
Compare
|
This PR was rebased onto a different main commit. Here's a range-diff highlighting what actually changed. Rebasing is a normal part of keeping PRs up to date, so no action is needed—this note is just to help reviewers. |
|
@scottmcm, sorry for the ping if I'm missing something for this PR to be reviewed, but it's been over a month. Are you available to look this over? |
| #[stable(feature = "duration_checked_float", since = "1.66.0")] | ||
| impl Error for crate::time::TryFromFloatSecsError {} | ||
| #[unstable(feature = "non_panicking_duration_conversion", issue = "153678")] | ||
| impl Error for crate::time::DurationConversionError {} |
There was a problem hiding this comment.
I think removing the Error and Display impls from TryFromFloatSecsError is a breaking change?
https://doc.rust-lang.org/std/time/struct.TryFromFloatSecsError.html#impl-Error-for-TryFromFloatSecsError
Maybe it's worth asking if DurationConversionError and its trait impls should be stabilised instead?
rust-lang/libs-team#749 (comment)
Here's the context from the meeting notes approving the ACP:
https://hackmd.io/rGWrzOppS8-ehldMMjWwKQ#new-change-proposal-rusttflibs749-ACP-Add-non-panicking-versions-of-Durationfrom_nanos_u128minshoursdaysweeks
Suddenly not being able to print the return type of the stable try_from_secs_f64() method seems surprising for users. So does having to name it using a stable alias that doesn't appear in the method docs.
Implements the methods discussed in the related ACP.
ACP: rust-lang/libs-team#749
Tracking issue: #153678