Auto merge of #42504 - michaelwoerister:hash-dep-nodes-prep, r=nikomatsakis
Some preparatory refactorings for hash-based DepNodes
This PR collects some changes that turn out to be necessary for implementing `DepNodes` based on stable hashes (see #42294). The commits are self-contained and mostly straightforward.
The most interesting change here is the introduction of `DefIndices` for things that are not part of the AST: Some pieces of crate metadata now have a `DefIndex` too.
cc @eddyb
r? @nikomatsakis