Skip to content
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 div_duration #124667

Merged
merged 3 commits into from
May 26, 2024
Merged

Stabilize div_duration #124667

merged 3 commits into from
May 26, 2024

Conversation

newpavlov
Copy link
Contributor

Closes #63139

@rustbot
Copy link
Collaborator

rustbot commented May 3, 2024

r? @jhpratt

rustbot has assigned @jhpratt.
They will have a look at your PR within the next two weeks and either review your PR or reassign to another reviewer.

Use r? to explicitly pick a reviewer

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs Relevant to the library team, which will review and decide on the PR/issue. labels May 3, 2024
@rust-log-analyzer

This comment has been minimized.

@jhpratt jhpratt added needs-fcp This change is insta-stable, so needs a completed FCP to proceed. I-libs-api-nominated The issue / PR has been nominated for discussion during a libs-api team meeting. labels May 3, 2024
@jhpratt
Copy link
Member

jhpratt commented May 3, 2024

This still needs FCP. Nominating for T-libs-api so they'll see it.

@joshtriplett joshtriplett added T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. and removed T-libs Relevant to the library team, which will review and decide on the PR/issue. I-libs-api-nominated The issue / PR has been nominated for discussion during a libs-api team meeting. labels May 14, 2024
@joshtriplett
Copy link
Member

We discussed this in today's @rust-lang/libs-api meeting. We were generally favorable towards adding these. But also, multiple people expressed a preference that these could be more accurate by doing the math in nanos rather than seconds.

That said:

@rfcbot merge

@rfcbot
Copy link

rfcbot commented May 14, 2024

Team member @joshtriplett 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.

@rfcbot rfcbot added proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. labels May 14, 2024
@newpavlov
Copy link
Contributor Author

newpavlov commented May 14, 2024

these could be more accurate by doing the math in nanos rather than seconds

Hm, comparing the two expressions:

let s1 = (d1.secs as f32) + (d1.nanos as f32) / (NANOS_PER_SEC as f32);
let s2 = (d2.secs as f32) + (d2.nanos as f32) / (NANOS_PER_SEC as f32);
s1 / s2
let s1 = (d1.secs as f32) * (NANOS_PER_SEC as f32) + (d1.nanos as f32);
let s2 = (d2.secs as f32) * (NANOS_PER_SEC as f32) + (d2.nanos as f32);
s1 / s2

I guess the latter should be indeed slightly more accurate. The former will often lose precision in the nanos division, while in the latter case, if loss of precision has happened during multiplication, addition of nanos is unlikely to change the final result.

Should I replace the methods implementation?

@rfcbot rfcbot added the final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. label May 15, 2024
@rfcbot
Copy link

rfcbot commented May 15, 2024

🔔 This is now entering its final comment period, as per the review above. 🔔

@rfcbot rfcbot removed the proposed-final-comment-period Proposed to merge/close by relevant subteam, see T-<team> label. Will enter FCP once signed off. label May 15, 2024
@jhpratt
Copy link
Member

jhpratt commented May 15, 2024

Should I replace the methods implementation?

I'm indifferent. The time crate divides the nanoseconds as integers, just as the current implementation in std does. At most I'd imagine this would only differ by a single nanosecond, but I haven't checked that.

@rfcbot rfcbot added finished-final-comment-period The final comment period is finished for this PR / Issue. to-announce Announce this issue on triage meeting and removed final-comment-period In the final comment period and will be merged soon unless new substantive objections are raised. labels May 25, 2024
@rfcbot
Copy link

rfcbot commented May 25, 2024

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.

This will be merged soon.

@jhpratt
Copy link
Member

jhpratt commented May 25, 2024

@bors r+

@bors
Copy link
Contributor

bors commented May 25, 2024

📌 Commit 8da41b1 has been approved by jhpratt

It is now in the queue for this repository.

@bors bors removed the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. label May 25, 2024
@bors bors added the S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. label May 25, 2024
bors added a commit to rust-lang-ci/rust that referenced this pull request May 25, 2024
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#121377 (Stabilize `LazyCell` and `LazyLock`)
 - rust-lang#122986 (Fix c_char on AIX)
 - rust-lang#123803 (Fix `VecDeque::shrink_to` UB when `handle_alloc_error` unwinds.)
 - rust-lang#124080 (Some unstable changes to where opaque types get defined)
 - rust-lang#124667 (Stabilize `div_duration`)
 - rust-lang#125472 (tidy: validate LLVM component names in tests)
 - rust-lang#125523 (Exit the process a short time after entering our ctrl-c handler)

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 80aea30 into rust-lang:master May 26, 2024
6 checks passed
@rustbot rustbot added this to the 1.80.0 milestone May 26, 2024
rust-timer added a commit to rust-lang-ci/rust that referenced this pull request May 26, 2024
Rollup merge of rust-lang#124667 - newpavlov:stabilize_div_duration, r=jhpratt

Stabilize `div_duration`

Closes rust-lang#63139
@newpavlov newpavlov deleted the stabilize_div_duration branch May 26, 2024 00:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
disposition-merge This issue / PR is in PFCP or FCP with a disposition to merge it. finished-final-comment-period The final comment period is finished for this PR / Issue. needs-fcp This change is insta-stable, so needs a completed FCP to proceed. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. to-announce Announce this issue on triage meeting
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Tracking issue for div_duration
7 participants