rust-lang / rust-lang/rustc-dev-guide

Explain all the stable hashing shenanigans

Open
#203 10 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

A-incr-comp C-enhancement E-help-wanted E-medium E-needs-writeup T-compiler
Dominant language
HTML
Stars
1.9k
Forks
613
Avg merge
17h 24m
Merged PRs (30d)
39

Description

So rustc is full of these impl_stable_hash_for. What are these for? I originally thought that would be for FxHashMap, but that seems to be wrong (I still need to derive(Hash) to use FxHashMap). So now I am just confused. It would be great if the guide could explain that.

@eddyb said "incremental" but that on its own does not explain much of anything -- why is Hash not good enough? Why do I need a tcx to compute a "stable hash"?

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating the guide section covering rustc's impl_stable_hash_for implementations. Explain what stable hashing is used for, why ordinary Hash is insufficient for incremental compilation, and why a tcx is needed; done means the guide answers each of these questions clearly.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
compilers, documentation
Issue type
Documentation
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.