add a bit about def path (#548)

This commit is contained in:
Who? Me?! 2019-12-31 06:46:18 -06:00 committed by Santiago Pastorino
parent 423808fb45
commit e668a1ff29
1 changed files with 6 additions and 0 deletions

View File

@ -102,6 +102,12 @@ sorts of identifiers in active use:
[`BodyId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/hir/struct.BodyId.html [`BodyId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/hir/struct.BodyId.html
[`NodeId`]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax/ast/struct.NodeId.html [`NodeId`]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax/ast/struct.NodeId.html
We also have an internal map to go from `DefId` to whats called "Def path". "Def path" is like a
module path but a bit more rich. For example, it may be `crate::foo::MyStruct` that identifies
this definition uniquely. Its a bit different than a module path because it might include a type
parameter `T`, which you can't write in normal rust, like `crate::foo::MyStruct::T`. These are used
in incremental compilation.
### The HIR Map ### The HIR Map
Most of the time when you are working with the HIR, you will do so via Most of the time when you are working with the HIR, you will do so via