Update hir.md

Fix method name and the link, as it's outdated.
This commit is contained in:
Yang Pan 2023-01-25 22:59:50 +08:00 committed by Tshepang Mbambo
parent 5ecd75a393
commit b6cc4604d0
1 changed files with 2 additions and 2 deletions

View File

@ -117,9 +117,9 @@ that `n` must be some HIR expression, you can do
[Expr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.Expr.html [Expr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/struct.Expr.html
Finally, you can use the HIR map to find the parents of nodes, via Finally, you can use the HIR map to find the parents of nodes, via
calls like [`tcx.hir().get_parent_node(n)`][get_parent_node]. calls like [`tcx.hir().get_parent(n)`][get_parent].
[get_parent_node]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.get_parent_node [get_parent]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.get_parent
## HIR Bodies ## HIR Bodies