Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Implement int_roundings (div_floor, div_ceil, next_multiple_of, checked_next_multiple_of) #88582

Merged
merged 1 commit into from
Sep 2, 2021

Conversation

jhpratt
Copy link
Member

@jhpratt jhpratt commented Sep 2, 2021

See #88581 for details. This API was discussed on Zulip.

@rustbot label: +T-libs-api +S-waiting-on-review

r? @joshtriplett

@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 Sep 2, 2021
@joshtriplett
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Sep 2, 2021

📌 Commit 727a4fc has been approved by joshtriplett

@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-review Status: Awaiting review from the assignee but also interested parties. labels Sep 2, 2021
bors added a commit to rust-lang-ci/rust that referenced this pull request Sep 2, 2021
Rollup of 12 pull requests

Successful merges:

 - rust-lang#88177 (Stabilize std::os::unix::fs::chroot)
 - rust-lang#88505 (Use `unwrap_unchecked` where possible)
 - rust-lang#88512 (Upgrade array_into_iter lint to include Deref-to-array types.)
 - rust-lang#88532 (Remove single use variables)
 - rust-lang#88543 (Improve closure dummy capture suggestion in macros.)
 - rust-lang#88560 (`fmt::Formatter::pad`: don't call chars().count() more than one time)
 - rust-lang#88565 (Add regression test for issue 83190)
 - rust-lang#88567 (Remove redundant `Span` in `QueryJobInfo`)
 - rust-lang#88573 (rustdoc: Don't panic on ambiguous inherent associated types)
 - rust-lang#88582 (Implement rust-lang#88581)
 - rust-lang#88589 (Correct doc comments inside `use_expr_visitor.rs`)
 - rust-lang#88592 (Fix ICE in const check)

Failed merges:

r? `@ghost`
`@rustbot` modify labels: rollup
@bors bors merged commit 2159c5d into rust-lang:master Sep 2, 2021
@rustbot rustbot added this to the 1.56.0 milestone Sep 2, 2021
@jhpratt jhpratt deleted the int_roundings branch September 2, 2021 21:33
@elichai
Copy link
Contributor

elichai commented Sep 3, 2021

Note that this broke num-bigint:

error[E0658]: use of unstable library feature 'int_roundings'
   --> /home/travis/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/num-bigint-0.3.2/src/biguint.rs:393:45
    |
393 |                 let root_scale = extra_bits.div_ceil(&n64);
    |                                             ^^^^^^^^
    |
    = note: see issue #88581 <https://github.com/rust-lang/rust/issues/88581> for more information
    = help: add `#![feature(int_roundings)]` to the crate attributes to enable
error[E0308]: mismatched types
   --> /home/travis/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/num-bigint-0.3.2/src/biguint.rs:393:54
    |
393 |                 let root_scale = extra_bits.div_ceil(&n64);
    |                                                      ^^^^ expected `u64`, found `&u64`
    |
help: consider removing the borrow
    |
393 -                 let root_scale = extra_bits.div_ceil(&n64);
393 +                 let root_scale = extra_bits.div_ceil(n64);
    | 
error[E0658]: use of unstable library feature 'int_roundings'
  --> /home/travis/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/num-bigint-0.3.2/src/biguint/convert.rs:70:10
   |
70 |         .div_ceil(&big_digit::BITS.into())
   |          ^^^^^^^^
   |
   = note: see issue #88581 <https://github.com/rust-lang/rust/issues/88581> for more information
   = help: add `#![feature(int_roundings)]` to the crate attributes to enable
error[E0308]: mismatched types
  --> /home/travis/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/num-bigint-0.3.2/src/biguint/convert.rs:70:19
   |
70 |         .div_ceil(&big_digit::BITS.into())
   |                   ^^^^^^^^^^^^^^^^^^^^^^^ expected `u64`, found reference
   |
   = note:   expected type `u64`
           found reference `&_`
help: consider removing the borrow
   |
70 -         .div_ceil(&big_digit::BITS.into())
70 +         .div_ceil(big_digit::BITS.into())
   | 
error[E0658]: use of unstable library feature 'int_roundings'
   --> /home/travis/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/num-bigint-0.3.2/src/biguint/convert.rs:585:10
    |
585 |         .div_ceil(&u64::from(bits))
    |          ^^^^^^^^
    |
    = note: see issue #88581 <https://github.com/rust-lang/rust/issues/88581> for more information
    = help: add `#![feature(int_roundings)]` to the crate attributes to enable
error[E0308]: mismatched types
   --> /home/travis/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/num-bigint-0.3.2/src/biguint/convert.rs:585:19
    |
585 |         .div_ceil(&u64::from(bits))
    |                   ^^^^^^^^^^^^^^^^ expected `u64`, found `&u64`
    |
help: consider removing the borrow
    |
585 -         .div_ceil(&u64::from(bits))
585 +         .div_ceil(u64::from(bits))
    | 
error[E0658]: use of unstable library feature 'int_roundings'
   --> /home/travis/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/num-bigint-0.3.2/src/biguint/convert.rs:613:10
    |
613 |         .div_ceil(&u64::from(bits))
    |          ^^^^^^^^
    |
    = note: see issue #88581 <https://github.com/rust-lang/rust/issues/88581> for more information
    = help: add `#![feature(int_roundings)]` to the crate attributes to enable
error[E0308]: mismatched types
   --> /home/travis/.cargo/registry/src/github.heygears.com-1ecc6299db9ec823/num-bigint-0.3.2/src/biguint/convert.rs:613:19
    |
613 |         .div_ceil(&u64::from(bits))
    |                   ^^^^^^^^^^^^^^^^ expected `u64`, found `&u64`
    |
help: consider removing the borrow
    |
613 -         .div_ceil(&u64::from(bits))
613 +         .div_ceil(u64::from(bits))
    | 
    

@jhpratt
Copy link
Member Author

jhpratt commented Sep 3, 2021

As I stated in #88581, that is considered acceptable breakage.

@dtolnay dtolnay changed the title Implement #88581 Implement int_roundings (div_floor, div_ceil, next_multiple_of, checked_next_multiple_of) Apr 5, 2024
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
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.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants