Skip to content

Add a bit about def path #548

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 31, 2019
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions src/hir.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down