Skip to content

Commit 9b0c6bd

Browse files
Add actual link to to_def_id
1 parent b7d099d commit 9b0c6bd

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/hir.md

+3-1
Original file line numberDiff line numberDiff line change
@@ -88,7 +88,7 @@ sorts of identifiers in active use:
8888
expected, because it prevents [`DefId`] from upstream crates from
8989
being passed instead and causing bugs at compile time.
9090
- They can still be transformed back into `DefId`s as needed by using
91-
the [`LocalDefId::to_def_id`] method.
91+
the [`LocalDefId::to_def_id`][to_def_id] method.
9292
- [`HirId`], which combines the index of a particular item with an
9393
offset within that item.
9494
- the key point of a [`HirId`] is that it is *relative* to some item
@@ -102,6 +102,8 @@ sorts of identifiers in active use:
102102
[`HirId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir_id/struct.HirId.html
103103
[`BodyId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.BodyId.html
104104

105+
[to_def_id]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/def_id/struct.LocalDefId.html#method.to_def_id
106+
105107
We also have an internal map to go from `DefId` to what’s called "Def path". "Def path" is like a
106108
module path but a bit more rich. For example, it may be `crate::foo::MyStruct` that identifies
107109
this definition uniquely. It’s a bit different than a module path because it might include a type

0 commit comments

Comments
 (0)