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

Compilation broken on nightly (int_roundings feature) #218

Closed
fourbytes opened this issue Sep 3, 2021 · 4 comments · Fixed by #219
Closed

Compilation broken on nightly (int_roundings feature) #218

fourbytes opened this issue Sep 3, 2021 · 4 comments · Fixed by #219

Comments

@fourbytes
Copy link

Just updated to the latest rustc nightly, looks like this new change breaks compilation of this crate.

error[E0658]: use of unstable library feature 'int_roundings'
error[E0658]: use of unstable library feature 'int_roundings'
   --> /home/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/src/biguint.rs:398:45
    |
398 |                 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/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/src/biguint.rs:398:54
    |
398 |                 let root_scale = extra_bits.div_ceil(&n64);
    |                                                      ^^^^ expected `u64`, found `&u64`
    |
help: consider removing the borrow
    |
398 -                 let root_scale = extra_bits.div_ceil(&n64);
398 +                 let root_scale = extra_bits.div_ceil(n64);
    |

error[E0658]: use of unstable library feature 'int_roundings'
  --> /home/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/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/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/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/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/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/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/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/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/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/fourbytes/.cargo/registry/src/github.com-1ecc6299db9ec823/num-bigint-0.4.1/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))
    |

Some errors have detailed explanations: E0308, E0658.
For more information about an error, try `rustc --explain E0308`.
error: could not compile `num-bigint` due to 8 previous errors
warning: build failed, waiting for other jobs to finish...
error: build failed
@online2311
Copy link

I also encountered this problem

@rainliu
Copy link

rainliu commented Sep 3, 2021

@cuviper
Copy link
Member

cuviper commented Sep 3, 2021

It will need to use explicit Integer::div_ceil to avoid the new unstable inherent method.

mtreinish added a commit to mtreinish/retworkx that referenced this issue Sep 3, 2021
The coverage ci job uses the rust nightly channel to enable the coverage
collection. However, building with nightly has recently stopped working
because of a change breaking num-bigint (see
rust-num/num-bigint#218 for more details).
Until the rustc nightly behavior is reverted or a new num-bigint version
is released that is compatible with the new nightly behavior this commit
pins the nightly version used in the coverage job to a version prior to
the failure.
mtreinish added a commit to Qiskit/rustworkx that referenced this issue Sep 3, 2021
The coverage ci job uses the rust nightly channel to enable the coverage
collection. However, building with nightly has recently stopped working
because of a change breaking num-bigint (see
rust-num/num-bigint#218 for more details).
Until the rustc nightly behavior is reverted or a new num-bigint version
is released that is compatible with the new nightly behavior this commit
pins the nightly version used in the coverage job to a version prior to
the failure.
bors bot added a commit that referenced this issue Sep 3, 2021
219: rust: use explicitily Integer::div_ceil r=cuviper a=catenacyber

Fixes #218

cf rust-lang/rust#88581

Co-authored-by: Philippe Antoine <[email protected]>
Co-authored-by: Josh Stone <[email protected]>
@bors bors bot closed this as completed in 8ee0b9a Sep 3, 2021
@cuviper cuviper mentioned this issue Sep 3, 2021
bors bot added a commit that referenced this issue Sep 3, 2021
220: Release 0.3.3 r=cuviper a=cuviper

This backports the changes to fix the use of `div_ceil`, #218.

Co-authored-by: Philippe Antoine <[email protected]>
Co-authored-by: Josh Stone <[email protected]>
@cuviper
Copy link
Member

cuviper commented Sep 3, 2021

I've now published 0.3.3 and 0.4.2 with the fix for this.

edouardparis added a commit to edouardparis/revault-gui that referenced this issue Sep 6, 2021
compilation was broken on nightly:
rust-num/num-bigint#218

cargo update -p num-bigint
JesseWright added a commit to JesseWright/smithy-rs that referenced this issue Sep 6, 2021
rust-lang/rust#88581 adds several new integer methods as inherent impls. These new methods are a breaking change accepted as a minor change. They already cause build failures with nightly and will eventually cause build failures with stable as well, unless rust-lang changes course. This uses `Integer::div_floor` explicitly to avoid accidentally calling the new nightly methods, same as done for rust-num/num-bigint#218.
edouardparis added a commit to edouardparis/revault-gui that referenced this issue Sep 8, 2021
compilation was broken on nightly:
rust-num/num-bigint#218

cargo update -p num-bigint
edouardparis added a commit to revault/revault-gui that referenced this issue Sep 8, 2021
0738532 fix dep: bump num-bigint (edouard)

Pull request description:

  compilation was broken on nightly:
  rust-num/num-bigint#218

  cargo update -p num-bigint

ACKs for top commit:
  danielabrozzoni:
    utACK 0738532

Tree-SHA512: b91dd8bc9fc6a255284dd0a0f2ea27d6b549c9b27fd89119a73a0a18452bba6060f6b617bacc0a8f068639fd22de4414aace650a9b1f2daae5ef2e971859b104
rcoh added a commit to smithy-lang/smithy-rs that referenced this issue Sep 15, 2021
* Use `Integer::div_floor` explicitly

rust-lang/rust#88581 adds several new integer methods as inherent impls. These new methods are a breaking change accepted as a minor change. They already cause build failures with nightly and will eventually cause build failures with stable as well, unless rust-lang changes course. This uses `Integer::div_floor` explicitly to avoid accidentally calling the new nightly methods, same as done for rust-num/num-bigint#218.

* run cargo fmt

Co-authored-by: Russell Cohen <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants