Skip to content

Commit e668a1f

Browse files
mark-i-mspastorino
authored andcommitted
add a bit about def path (#548)
1 parent 423808f commit e668a1f

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

src/hir.md

+6
Original file line numberDiff line numberDiff line change
@@ -102,6 +102,12 @@ sorts of identifiers in active use:
102102
[`BodyId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc/hir/struct.BodyId.html
103103
[`NodeId`]: https://doc.rust-lang.org/nightly/nightly-rustc/syntax/ast/struct.NodeId.html
104104

105+
We also have an internal map to go from `DefId` to what’s called "Def path". "Def path" is like a
106+
module path but a bit more rich. For example, it may be `crate::foo::MyStruct` that identifies
107+
this definition uniquely. It’s a bit different than a module path because it might include a type
108+
parameter `T`, which you can't write in normal rust, like `crate::foo::MyStruct::T`. These are used
109+
in incremental compilation.
110+
105111
### The HIR Map
106112

107113
Most of the time when you are working with the HIR, you will do so via

0 commit comments

Comments
 (0)