File tree 1 file changed +2
-2
lines changed
1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -139,12 +139,12 @@ defined in the map. By matching on this, you can find out what sort of
139
139
node the ` HirId ` referred to and also get a pointer to the data
140
140
itself. Often, you know what sort of node ` n ` is – e.g. if you know
141
141
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
143
143
[ ` &hir::Expr ` ] [ Expr ] , panicking if ` n ` is not in fact an expression.
144
144
145
145
[ find ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.find
146
146
[ `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
148
148
[ Expr ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc_hir/hir/struct.Expr.html
149
149
150
150
Finally, you can use the HIR map to find the parents of nodes, via
You can’t perform that action at this time.
0 commit comments