rust-lang / rustc-hash

Custom hash algorithm used by rustc (plus hashmap/set aliases): fast, deterministic, not secure
Apache License 2.0
394 stars 46 forks source link

v1.2.0 seems to break without `std` #42

Closed vados-cosmonic closed 5 months ago

vados-cosmonic commented 5 months ago

It seems that the latest version of rustc-hash has a a small bug -- it attempts to use std without first checking for the feature flag:

   Compiling rustc-hash v1.2.0
error[E0433]: failed to resolve: use of undeclared crate or module `std`
 --> /home/user/.cargo/registry/src/index.crates.io-6f17d22bba15001f/rustc-hash-1.2.0/src/seeded_state.rs:1:5
  |
1 | use std::collections::{HashMap, HashSet};
  |     ^^^ use of undeclared crate or module `std`

For more information about this error, try `rustc --explain E0433`.
error: could not compile `rustc-hash` (lib) due to 1 previous error
warning: build failed, waiting for other jobs to finish...

The bug seems to be in seeded_state.rs, as the module is not guarded by the std feature.

For context, the dependency that I was actually trying to build that uses rustc-hash is wasmtime.

lqd commented 5 months ago

IIUC this should be fixed by #41

vados-cosmonic commented 5 months ago

Ah thanks -- just made a PR for this, but will wait for that one to merge -- is it possible to yank the version that was released so builds can pass in the interim?

zimond commented 5 months ago

@davidtwco please consider yank 1.2.0

davidtwco commented 5 months ago

I've yanked 1.2.0

vados-cosmonic commented 5 months ago

Appreciate it @davidtwco ! 🙇 Confirming that builds are 🟢 on my side, closing this!