Skip to content

Commit 0d36dfa

Browse files
authored
Rollup merge of #137504 - nnethercote:remove-Map-4, r=Zalathar
Move methods from Map to TyCtxt, part 4. A follow-up to rust-lang/rust#137350. r? ```@Zalathar```
2 parents a879001 + 7f5b5c3 commit 0d36dfa

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/hir.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -139,12 +139,12 @@ defined in the map. By matching on this, you can find out what sort of
139139
node the `HirId` referred to and also get a pointer to the data
140140
itself. Often, you know what sort of node `n` is – e.g. if you know
141141
that `n` must be some HIR expression, you can do
142-
[`tcx.hir().expect_expr(n)`][expect_expr], which will extract and return the
142+
[`tcx.hir_expect_expr(n)`][expect_expr], which will extract and return the
143143
[`&hir::Expr`][Expr], panicking if `n` is not in fact an expression.
144144

145145
[find]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.find
146146
[`Node`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/enum.Node.html
147-
[expect_expr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.expect_expr
147+
[expect_expr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.expect_expr
148148
[Expr]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Expr.html
149149

150150
Finally, you can use the HIR map to find the parents of nodes, via

0 commit comments

Comments
 (0)