rust-lang / rust-lang/rustc_public
Request: expose stable hash value for DefId
Nobody has claimed this yet.
- Dominant language
- Rust
- Stars
- 125
- Forks
- 19
- PR merge metrics
- No merged PRs in 30d
Description
TyCtxt::def_path_hash provides stable hash value for DefId.
A stable hash is important for cross-platform or cache-sensitive code.
To keep API simple, instead of returning DefPathHash, the hash value can just be two u64s.
Updated: it seems DefPathHash is also platform-dependent due to SVH. (Context)
In this case, there is no such stable DefId hash across platforms.
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
Start with TyCtxt::def_path_hash and DefPathHash, the two APIs linked in the issue, then verify the updated claim that DefPathHash is platform-dependent. Done means establishing whether a cross-platform stable DefId hash is possible and, if so, defining the public API; the issue supplies no file or test path.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- rust
- Domain
- compilers
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Needs clarification
- Newbie friendliness
- 25/100