krisprice / ipnet

IpNet, Ipv4Net, and Ipv6Net types and methods for Rust
Apache License 2.0
122 stars 26 forks source link

build error #14

Closed sallyyu0 closed 4 years ago

sallyyu0 commented 4 years ago

Getting following errors today, Any ideas please?

Compiling lock_api v0.3.1 error[E0658]: use of unstable library feature 'iter_nth_back' --> /home/zzz/.cargo/registry/src/github.com-1ecc6299db9ec823/ipnet-2.1.0/src/ipext.rs:638:5 638 / fn nth_back(&mut self, n: usize) -> OptionSelf::Item { 639 match *self { 640 IpAddrRange::V4(ref mut a) => a.nth_back(n).map(IpAddr::V4), 641 IpAddrRange::V6(ref mut a) => a.nth_back(n).map(IpAddr::V6), 642 } 643 } _____^

= note: for more information, see #56995

error[E0658]: use of unstable library feature 'iter_nth_back'

... error: aborting due to 5 previous errors

For more information about this error, try rustc --explain E0658. error: Could not compile ipnet. warning: build failed, waiting for other jobs to finish... error: build failed

krisprice commented 4 years ago

Hi Sally, I recently merged in #13 of some iterator functions @TyPR124 contributed. To confirm this problem you’re having doesn’t occur if you set the version to use specifically 2.0.1 right?

sallyyu0 commented 4 years ago

Hi krisprice, it happens as well. with version 2.0.1. And this just starting today. I'm wondering if any changes from compiler affected it.

krisprice commented 4 years ago

Can you check the version of rust you're using is 1.37.0 or later?

sallyyu0 commented 4 years ago

it's 1.36.0

krisprice commented 4 years ago

nth_back was stabilized in 1.37.0, can you try updating to the latest version of rust? I think that will solve your problem.

sallyyu0 commented 4 years ago

Right, I have 1.37.0 specified in Dockerfile so that works. But my newly built VM has cargo installed with older version. And I can't seem to update it to latest. How do I unsintall the older one before use rustup?

krisprice commented 4 years ago

That's going to depend on the OS you're using and its package management system, look into removing the default rust package that comes with your distribution, or look into using rustup to install rust in your home directory and just use that local copy. Let us know if you have any other issues come up. :smile: