From e668a1ff295cdb8ba389260e5423933e8ae6a0d9 Mon Sep 17 00:00:00 2001 From: Who? Me?! Date: Tue, 31 Dec 2019 06:46:18 -0600 Subject: [PATCH] add a bit about def path (#548) --- src/hir.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/hir.md b/src/hir.md index 0a48d112..67becec1 100644 --- a/src/hir.md +++ b/src/hir.md @@ -102,6 +102,12 @@ sorts of identifiers in active use: [`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 +We also have an internal map to go from `DefId` to what’s 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. It’s 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 Most of the time when you are working with the HIR, you will do so via