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

Partially stabilize int_roundings #94455

Merged
merged 2 commits into from
Aug 12, 2023

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Feb 28, 2022

This stabilizes the following:

impl uX {
    pub const fn div_ceil(self, rhs: Self) -> Self;
    pub const fn next_multiple_of(self, rhs: Self) -> Self;
    pub const fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>;
}

This feature is tracked in #88581.

@rustbot rustbot added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue. labels Feb 28, 2022
@joshtriplett joshtriplett added I-libs-api-nominated Nominated for discussion during a libs-api team meeting. and removed I-libs-api-nominated Nominated for discussion during a libs-api team meeting. labels Mar 2, 2022
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Apr 11, 2022
@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels May 8, 2022
@jhpratt
Copy link
Member Author

jhpratt commented May 11, 2022

With this re-entering FCP, I've updated the PR to reflect the rustc version it will be stabilized in. As there's a release next week, it'll land in 1.63 rather than the currently nightly (1.62).

@JohnCSimon JohnCSimon added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 20, 2022
@JohnTitor JohnTitor added S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. and removed S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jun 20, 2022
@bors
Copy link
Contributor

bors commented Jun 29, 2022

☔ The latest upstream changes (presumably #98656) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Jun 29, 2022
@Dylan-DPC Dylan-DPC added S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. S-waiting-on-review Status: Awaiting review from the assignee but also interested parties. labels Jul 24, 2022
@Dylan-DPC
Copy link
Member

@jhpratt if you can resolve these conflicts we can push this forward

@jhpratt
Copy link
Member Author

jhpratt commented Jul 24, 2022

The reason I hadn't resolved the conflicts is because FCP hasn't even started. There is still a blocker in the tracking issue.

@est31
Copy link
Member

est31 commented Aug 27, 2022

👋 Hello, I'm writing this comment in this stabilization PR to notify you, the authors of this PR, that #100591 has been merged, which implemented a change in how features are stabilized.

Your PR has been filed before the change, so will likely require modifications in order to comply with the new rules. I recommend you to:

  1. rebase the PR onto latest master, so that uses of the placeholder are possible.
  2. replace the version numbers in the PR with the placeholder CURRENT_RUSTC_VERSION. For language changes, this means the version numbers in accepted.rs (example: 4caedba). For library changes, this means the since fields (example e576a9b).

That's it! The CURRENT_RUSTC_VERSION placeholder will, as part of the release process, be replaced with the version number that the PR merged for. It can be used anywhere in rust-lang/rust, not just accepted.rs and the since fields.

If you have any questions, feel free to drop by the zulip stream, or ping me directly in this PR's thread. Thanks! 👋

@jhpratt
Copy link
Member Author

jhpratt commented Aug 27, 2022

Thanks @est31! I knew it was discussed on Zulip but didn't realize you had actually implemented it. I've just updated this PR to use it.

@rustbot label -S-waiting-on-author

@rustbot rustbot removed the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Aug 27, 2022
@bors
Copy link
Contributor

bors commented Nov 17, 2022

☔ The latest upstream changes (presumably #103138) made this pull request unmergeable. Please resolve the merge conflicts.

@bors bors added the S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. label Nov 17, 2022
@jhpratt
Copy link
Member Author

jhpratt commented Jul 31, 2023

It's in FCP. Once that's done, I'll update the PR.

@rust-log-analyzer

This comment has been minimized.

@joshtriplett
Copy link
Member

@bors r+ rollup

@jhpratt Thank you for your persistence in getting these stabilized!

@bors
Copy link
Contributor

bors commented Aug 12, 2023

📌 Commit 62ca5aa has been approved by joshtriplett

It is now in the queue for this repository.

@bors bors added S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. and removed S-waiting-on-author Status: This is awaiting some action (such as code changes or more information) from the author. labels Aug 12, 2023
@jhpratt jhpratt changed the title Stabilize int_roundings Partially stabilize int_roundings Aug 12, 2023
@jhpratt
Copy link
Member Author

jhpratt commented Aug 12, 2023

It only took a year and a half and three FCPs!

matthiaskrgr added a commit to matthiaskrgr/rust that referenced this pull request Aug 12, 2023
…joshtriplett

Partially stabilize `int_roundings`

This stabilizes the following:

```rust
impl uX {
    pub const fn div_ceil(self, rhs: Self) -> Self;
    pub const fn next_multiple_of(self, rhs: Self) -> Self;
    pub const fn checked_next_multiple_of(self, rhs: Self) -> Option<Self>;
}
```

This feature is tracked in rust-lang#88581.
bors added a commit to rust-lang-ci/rust that referenced this pull request Aug 12, 2023
…iaskrgr

Rollup of 7 pull requests

Successful merges:

 - rust-lang#94455 (Partially stabilize `int_roundings`)
 - rust-lang#114132 (Better Debug for Vars and VarsOs)
 - rust-lang#114584 (E0277 nolonger points at phantom `.await`)
 - rust-lang#114667 (Record binder for bare trait object in LifetimeCollectVisitor)
 - rust-lang#114692 (downgrade `internal_features` to warn)
 - rust-lang#114703 (Cover ParamConst in smir)
 - rust-lang#114734 (Mark oli as "on vacation")

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 9aea966 into rust-lang:master Aug 12, 2023
11 checks passed
@rustbot rustbot added this to the 1.73.0 milestone Aug 12, 2023
dtolnay added a commit to dtolnay/precise that referenced this pull request Aug 13, 2023
As of nightly-2023-08-13, num-bigint 0.4.0 no longer compiles because of rust-lang/rust#94455.

    error[E0308]: mismatched types
        --> num-bigint-0.4.0/src/biguint/convert.rs:70:19
         |
    70   |         .div_ceil(&big_digit::BITS.into())
         |          -------- ^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found `&_`
         |          |
         |          arguments to this method are incorrect
         |
         = note:   expected type `u64`
                 found reference `&_`
    note: method defined here
        --> .rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/mod.rs:1167:5
         |
    1167 | /     uint_impl! {
    1168 | |         Self = u64,
    1169 | |         ActualT = u64,
    1170 | |         SignedT = i64,
    ...    |
    1184 | |         bound_condition = "",
    1185 | |     }
         | |_____^
         = note: this error originates in the macro `uint_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: consider removing the borrow
         |
    70   -         .div_ceil(&big_digit::BITS.into())
    70   +         .div_ceil(big_digit::BITS.into())
         |

    error[E0308]: mismatched types
        --> num-bigint-0.4.0/src/biguint/convert.rs:585:19
         |
    585  |         .div_ceil(&u64::from(bits))
         |          -------- ^^^^^^^^^^^^^^^^ expected `u64`, found `&u64`
         |          |
         |          arguments to this method are incorrect
         |
    note: method defined here
        --> .rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/mod.rs:1167:5
         |
    1167 | /     uint_impl! {
    1168 | |         Self = u64,
    1169 | |         ActualT = u64,
    1170 | |         SignedT = i64,
    ...    |
    1184 | |         bound_condition = "",
    1185 | |     }
         | |_____^
         = note: this error originates in the macro `uint_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: consider removing the borrow
         |
    585  -         .div_ceil(&u64::from(bits))
    585  +         .div_ceil(u64::from(bits))
         |

    error[E0308]: mismatched types
        --> num-bigint-0.4.0/src/biguint/convert.rs:613:19
         |
    613  |         .div_ceil(&u64::from(bits))
         |          -------- ^^^^^^^^^^^^^^^^ expected `u64`, found `&u64`
         |          |
         |          arguments to this method are incorrect
         |
    note: method defined here
        --> .rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/mod.rs:1167:5
         |
    1167 | /     uint_impl! {
    1168 | |         Self = u64,
    1169 | |         ActualT = u64,
    1170 | |         SignedT = i64,
    ...    |
    1184 | |         bound_condition = "",
    1185 | |     }
         | |_____^
         = note: this error originates in the macro `uint_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: consider removing the borrow
         |
    613  -         .div_ceil(&u64::from(bits))
    613  +         .div_ceil(u64::from(bits))
         |

    error[E0308]: mismatched types
        --> num-bigint-0.4.0/src/biguint.rs:398:54
         |
    398  |                 let root_scale = extra_bits.div_ceil(&n64);
         |                                             -------- ^^^^ expected `u64`, found `&u64`
         |                                             |
         |                                             arguments to this method are incorrect
         |
    note: method defined here
        --> .rustup/toolchains/nightly-x86_64-unknown-linux-gnu/lib/rustlib/src/rust/library/core/src/num/mod.rs:1167:5
         |
    1167 | /     uint_impl! {
    1168 | |         Self = u64,
    1169 | |         ActualT = u64,
    1170 | |         SignedT = i64,
    ...    |
    1184 | |         bound_condition = "",
    1185 | |     }
         | |_____^
         = note: this error originates in the macro `uint_impl` (in Nightly builds, run with -Z macro-backtrace for more info)
    help: consider removing the borrow
         |
    398  -                 let root_scale = extra_bits.div_ceil(&n64);
    398  +                 let root_scale = extra_bits.div_ceil(n64);
         |
@joshtriplett joshtriplett added the relnotes Marks issues that should be documented in the release notes of the next release. label Aug 15, 2023
vDorst added a commit to vDorst/embassy that referenced this pull request Aug 21, 2023
Currently next_multiple_of() is behinged a Feature gate: int_rounding.
See rust-lang/rust#88581
But it seems that this function is stablized in rust 1.73.
See rust-lang/rust#94455

Currently Embassy is still using nightly for many other unstable
features. So I do see an issue to use this function.
vDorst added a commit to vDorst/embassy that referenced this pull request Aug 23, 2023
Currently next_multiple_of() is behinged a Feature gate: int_rounding.
See rust-lang/rust#88581
But it seems that this function is stablized in rust 1.73.
See rust-lang/rust#94455

Currently Embassy is still using nightly for many other unstable
features. So I do see an issue to use this function.
@jhpratt jhpratt deleted the stabilize-int_roundings branch September 21, 2023 00:57
@Rua
Copy link
Contributor

Rua commented Apr 28, 2024

What happened to this? It's not stable yet but was supposed to be in 1.73?

@est31
Copy link
Member

est31 commented Apr 28, 2024

@Rua it's stable for unsigned integers only. You probably tried to use these functions with signed integers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
relnotes Marks issues that should be documented in the release notes of the next release. S-waiting-on-bors Status: Waiting on bors to run and complete tests. Bors will change the label on completion. S-waiting-on-fcp Status: PR is in FCP and is awaiting for FCP to complete. T-libs-api Relevant to the library API team, which will review and decide on the PR/issue.
Projects
None yet
Development

Successfully merging this pull request may close these issues.