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

Undeclared dependence on newer Rust features #444

Open
geemus opened this issue Dec 3, 2024 · 0 comments
Open

Undeclared dependence on newer Rust features #444

geemus opened this issue Dec 3, 2024 · 0 comments

Comments

@geemus
Copy link

geemus commented Dec 3, 2024

v0.12.2 relies on #is_non_or from Rust 1.82.0 and #is_bits stabilization from Rust 1.83.0 (if I'm not mistaken from looking at changelogs).

I previously had Rust 1.78.0 on my machine and attempting to install resulted in:

error[E0599]: no method named `is_none_or` found for enum `std::option::Option` in the current scope
  --> /home/geemus/.cargo/registry/src/index.crates.io-6f17d22bba15001f/viceroy-lib-0.12.2/src/acl.rs:61:24
   |
61 |                 if acc.is_none_or(|prev_match: &Entry| mask >= prev_match.prefix.mask) {
   |                        ^^^^^^^^^^
   |
help: there is a method `is_none` with a similar name, but with different arguments
  --> /tmp/rust-20240518-13478-4dthw7/rustc-1.78.0-src/library/core/src/option.rs:651:5

error[E0658]: use of unstable library feature 'ip_bits'
  --> /home/geemus/.cargo/registry/src/index.crates.io-6f17d22bba15001f/viceroy-lib-0.12.2/src/acl.rs:92:32
   |
92 |                     IpAddr::V4(Ipv4Addr::from_bits(v4.to_bits() & bit_mask)),
   |                                ^^^^^^^^^^^^^^^^^^^
   |
   = note: see issue #113744 <https://github.com/rust-lang/rust/issues/113744> for more information

error[E0658]: use of unstable library feature 'ip_bits'
  --> /home/geemus/.cargo/registry/src/index.crates.io-6f17d22bba15001f/viceroy-lib-0.12.2/src/acl.rs:92:55
   |
92 |                     IpAddr::V4(Ipv4Addr::from_bits(v4.to_bits() & bit_mask)),
   |                                                       ^^^^^^^
   |
   = note: see issue #113744 <https://github.com/rust-lang/rust/issues/113744> for more information

error[E0658]: use of unstable library feature 'ip_bits'
   --> /home/geemus/.cargo/registry/src/index.crates.io-6f17d22bba15001f/viceroy-lib-0.12.2/src/acl.rs:100:32
    |
100 |                     IpAddr::V6(Ipv6Addr::from_bits(v6.to_bits() & bit_mask)),
    |                                ^^^^^^^^^^^^^^^^^^^
    |
    = note: see issue #113744 <https://github.com/rust-lang/rust/issues/113744> for more information

error[E0658]: use of unstable library feature 'ip_bits'
   --> /home/geemus/.cargo/registry/src/index.crates.io-6f17d22bba15001f/viceroy-lib-0.12.2/src/acl.rs:100:55
    |
100 |                     IpAddr::V6(Ipv6Addr::from_bits(v6.to_bits() & bit_mask)),
    |                                                       ^^^^^^^
    |
    = note: see issue #113744 <https://github.com/rust-lang/rust/issues/113744> for more information

We also have github actions that use viceroy which were failing with the is_non_or problem. It attempts to pull the latest viceroy, but is relying on whatever version of rust is available, which will be 1.83.0 it looks like from github-actions/runner-images, but isn't there yet. We will probably also fix this to lock the viceroy version so it advances when we tell it to, rather than always tracking latest.

Updating to Rust 1.83.0 fixed both kinds of issues, which was easy enough on my machine, but is more complicated in github actions.

Anyway, I wanted to call this out as it would be nice if the cargo manifest explicitly specified the minimum expected Rust version (or else the code was more backwards compatible).

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

No branches or pull requests

1 participant