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

fails to compile with minimal-versions #133

Open
joseluis opened this issue Jan 28, 2025 · 2 comments · May be fixed by #134
Open

fails to compile with minimal-versions #133

joseluis opened this issue Jan 28, 2025 · 2 comments · May be fixed by #134

Comments

@joseluis
Copy link

num-rational fails to compile with the minimal-versions indicated in the manifest because num-bigint version 0.4.0 is insufficient. It should be updated to version 0.4.2 since that's the first version that compiles.

Test:

cargo +nightly update -Z minimal-versions
cargo build
@cuviper
Copy link
Member

cuviper commented Jan 28, 2025

The actual error:

error[E0308]: mismatched types
  --> /home/jistone/.cargo/registry/src/index.crates.io-6f17d22bba15001f/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 `&_`

(and several more like that)

That's not a dependency problem, just that the older num-bigint has errors with newer toolchains since the stabilization of inherent div_ceil methods in Rust 1.73, when it intends to use Integer::div_ceil that takes a reference. (Fixed in rust-num/num-bigint#219.) It does work if you're using an older toolchain though, like the MSRV 1.60.0.

This is an example why -Z minimal-versions is not a great tool, IMO.
(-Z direct-minimal-versions is a little better, since it only affects those in your own control.)

@joseluis
Copy link
Author

the older num-bigint has errors with newer toolchains (...)
It does work if you're using an older toolchain though

I see ... Although I'm not sure what the downside would be if requiring bigint 0.4.2 from num-rational 0.4.3, allowing them to be more in sync. MSRV would still be the same.

direct-minimal-versions is a little better, since it only affects those in your own control

I see them as complementary. minimal-versions goes deeper and does not forgive...

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.

2 participants