-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Tracking Issue for duration_constructors_lite #140881
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
…_lite, r=BurntSushi Split duration_constructors to get non-controversial constructors out This implements rust-lang#140881
Rollup merge of rust-lang#140882 - Dietr1ch:dev/duration_constructors_lite, r=BurntSushi Split duration_constructors to get non-controversial constructors out This implements rust-lang#140881
I don't think this feature will change at all. Should I just draft the stabilisation PR? It might seem soon, but this has been discussed for a while in |
@rfcbot fcp merge This feature is new, but they represent a less controversial subset of One concern that has been raised about the hour/minute constructors is that of leap seconds (since some minutes have 61 seconds and in theory some minutes could have 59 seconds, although a negative leap second has never occurred). In my experience, there is no widespread practice for interpreting an hour as anything different from 60 minutes and interpreting a minute as anything different from 60 seconds, despite the presence of leap seconds. Moreover, our As for why these were split out of |
Team member @BurntSushi has proposed to merge this. The next step is review by the rest of the tagged team members: No concerns currently listed. Once a majority of reviewers approve (and at most 2 approvals are outstanding), this will enter its final comment period. If you spot a major issue that hasn't been raised at any point in this process, please speak up! See this document for info about what commands tagged team members can give me. |
…_lite, r=BurntSushi Split duration_constructors to get non-controversial constructors out This implements rust-lang#140881
Uh oh!
There was an error while loading. Please reload this page.
Feature gate:
#![feature(duration_constructors_lite)]
This is a tracking issue for
duration_constructors_lite
.duration_constructors_lite
implements the non-controversial bits ofduration_constructors
.Public API
std::time::Duration
from_mins(u64)
from_hours(u64)
History
(Remember to update the
S-tracking-*
label when checking boxes.)duration_constructors
implementation core: add Duration constructors #120307Duration
constructorsfrom_mins
,from_hours
,from_days
andfrom_weeks
.from_days
andfrom_weeks
wrong too easy.CivilDuration
type to disambiguateDuration
as the "standard/scientific" time duration its safer to avoid introducingfrom_days
andfrom_weeks
even ifDuration
explicitly aims to model "standard/scientific".Steps
Unresolved Questions
from_days
and other larger quantities in the future.std
to help avoid mis-interpretingstd::time::Duration
.Misc
I want to thank all folks who participated in #120301. It's not fun to argue online for so long, but very much needed to grow the language in a sound way as it's even harder to undo mistakes.
Footnotes
https://std-dev-guide.rust-lang.org/feature-lifecycle/stabilization.html ↩
The text was updated successfully, but these errors were encountered: