rust-lang / rust-lang/rustdoc-types
`rustc-hash` feature is non-additive.
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 44
- Forks
- 20
- PR merge metrics
- No merged PRs in 30d
Description
cargo features are supposed to be additive, but rustc-hash isn't.
Consider the case where:
- Crate
adepends onrustdoc-typeswith default features- Crate
arelies on the HashMap using the default hasher.
- Crate
- Crate
bdepends onrustdoc-typeswithrustc-hashfeature. - Crate
cdepends onaandb
- Cargo does feature unification, and builds
aagainsrustdoc-typeswithrustc-hashenabled. afails to compile.
Potential fixes
- Ignore this, and hope it doesn't effect anyone
- Implement our own
BuildHashertype that doesn't expose the underlying hashing algo, so changing it is additive - Drop the
rustc-hashfeature, and always use it.
3.1. Drop therustc-hashfeature, and never use it. - Make
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
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
The issue concerns the rustc-hash Cargo feature and Cargo's feature unification, but it names no source files or tests. Start by tracing how the rustc-hash feature changes the HashMap hasher in rustdoc-types. Done requires choosing and implementing one of the listed approaches while preserving additive feature behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- build-system
- Issue type
- Bug
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100