cargo features are supposed to be additive, but rustc-hash isn't.
Consider the case where:
- Crate
a depends on rustdoc-types with default features
- Crate
a relies on the HashMap using the default hasher.
- Crate
b depends on rustdoc-types with rustc-hash feature.
- Crate
c depends on a and b
- Cargo does feature unification, and builds
a agains rustdoc-types with rustc-hash enabled.
a fails to compile.
Potential fixes
- Ignore this, and hope it doesn't effect anyone
- Implement our own
BuildHasher type that doesn't expose the underlying hashing algo, so changing it is additive
- Drop the
rustc-hash feature, and always use it.
3.1. Drop the rustc-hash feature, and never use it.
- Make
Crate generic over the hasher type.
I think it's fine to go with 1 for now, but I'm filling this issue so I don't forget this.
Originally reported by @Noratrieb on fediverse
Caused by #42
cargo features are supposed to be additive, but
rustc-hashisn't.Consider the case where:
adepends onrustdoc-typeswith default featuresarelies on the HashMap using the default hasher.bdepends onrustdoc-typeswithrustc-hashfeature.cdepends onaandbaagainsrustdoc-typeswithrustc-hashenabled.afails to compile.Potential fixes
BuildHashertype that doesn't expose the underlying hashing algo, so changing it is additiverustc-hashfeature, and always use it.3.1. Drop the
rustc-hashfeature, and never use it.Crategeneric over the hasher type.I think it's fine to go with 1 for now, but I'm filling this issue so I don't forget this.
Originally reported by @Noratrieb on fediverse
Caused by #42