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

Could not compile percent-encoding #665

Closed
danawoodman opened this issue Oct 3, 2019 · 5 comments
Closed

Could not compile percent-encoding #665

danawoodman opened this issue Oct 3, 2019 · 5 comments

Comments

@danawoodman
Copy link

I've just attempted to install reqwest 0.9.21 but it is failing with Could not compile 'percent-encoding'.

cargo build output:

cargo build
   Compiling nodrop v0.1.13
   Compiling lazy_static v1.4.0
   Compiling smallvec v0.6.10
   Compiling either v1.5.3
   Compiling cfg-if v0.1.10
   Compiling scopeguard v1.0.0
   Compiling slab v0.4.2
   Compiling fnv v1.0.6
   Compiling ppv-lite86 v0.2.5
   Compiling futures v0.1.29
   Compiling matches v0.1.8
   Compiling itoa v0.4.4
   Compiling rustc-demangle v0.1.16
   Compiling rand_core v0.4.2
   Compiling percent-encoding v1.0.1
   Compiling remove_dir_all v0.5.2
   Compiling percent-encoding v2.1.0
   Compiling regex-syntax v0.6.12
   Compiling indexmap v1.2.0
   Compiling try-lock v0.2.2
error: local variables in const fn are unstable
  --> /Users/danawoodman/.cargo/registry/src/github.com-1ecc6299db9ec823/percent-encoding-2.1.0/lib.rs:72:13
   |
72 |         let chunk = self.mask[byte as usize / BITS_PER_CHUNK];
   |             ^^^^^

   Compiling adler32 v1.0.4
error: aborting due to previous error

error: Could not compile `percent-encoding`.
warning: build failed, waiting for other jobs to finish...
error: build failed

My Cargo.toml:

[package]
name = "cli"
version = "0.1.0"
authors = ["Dana Woodman <...>"]
edition = "2018"

[dependencies]
reqwest = "0.9.21"
  • cargo -V: cargo 1.31.0 (339d9f9c8 2018-11-16)
  • rustc -V: rustc 1.31.0 (abe02cefd 2018-12-04)

I'm a new Rust user so not sure I'm missing anything but I think I followed the README exactly 🤷🏻‍♂️

@seanmonstar
Copy link
Owner

The error message might seem cryptic, but it's really just saying that your compiler is too old :) With a newer compiler, you'll be able to compile percent-encoding.

@danawoodman
Copy link
Author

@seanmonstar isn't 1.31 the latest version of Rust/Cargo?

@seanmonstar
Copy link
Owner

No, notice in the version string it was release last year. Rust has new versions every 6 weeks. The easiest way to manage Rust versions is using rustup.

@danawoodman
Copy link
Author

@seanmonstar 🤦‍♂ man that is not obvious. I guess I had installed Rust a year ago and then using the installation via curl https://sh.rustup.rs -sSf | sh doesn't actually update you automatically so I just assumed I was using the latest version. Would be cool if they made that more obvious, but obviously not your concern! Thanks and sorry for the false report!

@seanmonstar
Copy link
Owner

Yea, the messaging is unclear. But there's hope! A new RFC for allowing a crate to specify it's required Rust version looks like it may be approved, which could see better error message in the future.

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

2 participants