-
Notifications
You must be signed in to change notification settings - Fork 13.7k
Closed as not planned
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-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.
Description
Feature gate: #![feature(duration_new_checked)]
This is a tracking issue for Duration::new_checked()
and Duration::new_unchecked()
, which provide panic-free constructors for core::time::Duration
.
Public API
impl core::time::Duration {
// Returns `None` in cases where `Duration::new()` would panic
pub const fn new_checked(secs: u64, nanos: u32) -> Option<Duration>;
// Does not check for nanosecond overflow, enabling free conversion of known-good values.
pub const unsafe fn new_unchecked(secs: u64, subsec_nanos: u32) -> Duration;
}
Steps / History
- Implementation: Add
Duration::new_{checked,unchecked}
constructors #125749 - Final comment period (FCP)1
- Stabilization PR
Unresolved Questions
- None yet.
Footnotes
Metadata
Metadata
Assignees
Labels
C-tracking-issueCategory: An issue tracking the progress of sth. like the implementation of an RFCCategory: An issue tracking the progress of sth. like the implementation of an RFCT-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.