mrlazy1708/tqdm

Add minimum rust version to Cargo.toml

Closed this issue · 3 comments

error[E0015]: cannot call non-const fn `std::sync::Mutex::<Vec<std::sync::Arc<std::sync::Mutex<Info>>>>::new` in statics
   --> /home/USER/.cargo/registry/src/github.com-1ecc6299db9ec823/tqdm-0.4.3/src/lib.rs:306:45
    |
306 | static TQDM: Mutex<Vec<Arc<Mutex<Info>>>> = Mutex::new(Vec::new());
    |                                             ^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: calls in statics are limited to constant functions, tuple structs and tuple variants

For more information about this error, try `rustc --explain E0015`.

This crate does not compile due to the error above.

Turns out the crate did not compile because I was not using the latest version of rust. I'd suggest adding a minimum rust version to Cargo.toml

With the current language features used, the minimum required rust version is 1.63.0.

That's a good fix. Added here fbee466. Thanks!

Perfect.

Now that I think about it again, it might be nice to add a basic CI to test if the crate compiles using the MSRV.

That way if you use new language features the CI will fail and it reminds you to update it.