-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Stabilize Duration::MAX #84120
Stabilize Duration::MAX #84120
Conversation
@rfcbot merge (@workingjubilee can you rebase this? The first commit should now be included in the main branch.) |
Team member @m-ou-se 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. |
7883985
to
17234db
Compare
Rebased! |
🔔 This is now entering its final comment period, as per the review above. 🔔 |
I have added a small remark clarifying that |
This comment has been minimized.
This comment has been minimized.
e13bca8
to
6a60ccd
Compare
The final comment period, with a disposition to merge, as per the review above, is now complete. As the automated representative of the governance process, I would like to thank the author for their work and everyone else who contributed. The RFC will be merged soon. |
Considering we already have a stable Edit: And with .as_secs() and .subsec_nanos() there's not really any space in the other direction either. |
Duration is used in std to represent a difference between two Instants. As such, it has to at least contain that span of time in it. However, Instant can vary by platform. Thus, we should explain the impl of Duration::MAX is sensitive to these vagaries of the platform.
I removed the "64-bit" implication part of the remark, because you're completely right that it's not actually dependent on the target's hardware bitness. Currently you can input values into But people expect that. Duration, however, is supposed to be platform-agnostic, but it is actually Not, because |
6a60ccd
to
a80dbea
Compare
Yeah the situation is a bit weird with I don't think this description is very useful though:
Because we don't provide any way to construct arbitrary big How about we just say that it might vary by platform, but right now it's 584,942,417,355 years on all platforms? |
I'm good with that! It sounds like the appropriate mix of Ominous and Reassuring. /// May vary by platform as necessary. Must be able to contain the difference between
/// two instances of [`Instant`] or two instances of [`SystemTime`].
/// This constraint gives it a value of about 584,942,417,355 years in practice,
/// which is currently used on all platforms.
|
@bors r+ rollup |
📌 Commit 8278380 has been approved by |
⌛ Testing commit 8278380 with merge 8d859f836b759db255119449a8cc222b140e63dd... |
💔 Test failed - checks-actions |
A job failed! Check out the build log: (web) (plain) Click to see the possible cause of the failure (guessed by this bot)
|
@bors retry |
Rollup of 4 pull requests Successful merges: - rust-lang#84120 (Stabilize Duration::MAX) - rust-lang#84523 (Stabilize ordering_helpers.) - rust-lang#84551 (Unify the docs of std::env::{args_os, args} more) - rust-lang#84574 (rustdoc: Fix typos in maybe_inline_local fn) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Following the suggested direction from #76416 (comment), this PR proposes that
Duration::MAX
should have been part of theduration_saturating_ops
feature flag all along, having beenduration_constants
, as I expressed in Tracking issue for duration_constants #57391 (comment)Duration
#76114 which addedduration_saturating_ops
and accordingly should be folded into
duration_saturating_ops
and therefore stabilized.r? @m-ou-se