File tree 1 file changed +6
-5
lines changed
1 file changed +6
-5
lines changed Original file line number Diff line number Diff line change @@ -116,11 +116,12 @@ with an HIR node.
116
116
[ number of methods ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc/hir/map/struct.Map.html#methods
117
117
118
118
For example, if you have a [ ` DefId ` ] , and you would like to convert it
119
- to a [ ` NodeId ` ] , you can use [ ` tcx.hir.as_local_node_id(def_id) ` ] [ as_local_node_id ] . This
120
- returns an ` Option<NodeId> ` – this will be ` None ` if the def-id
121
- refers to something outside of the current crate (since then it has no
122
- HIR node), but otherwise returns ` Some(n) ` where ` n ` is the node-id of
123
- the definition.
119
+ to a [ ` NodeId ` ] , you can use
120
+ [ ` tcx.hir.as_local_node_id(def_id) ` ] [ as_local_node_id ] . This returns
121
+ an ` Option<NodeId> ` – this will be ` None ` if the def-id refers to
122
+ something outside of the current crate (since then it has no HIR
123
+ node), but otherwise returns ` Some(n) ` where ` n ` is the node-id of the
124
+ definition.
124
125
125
126
[ as_local_node_id ] : https://doc.rust-lang.org/nightly/nightly-rustc/rustc/hir/map/struct.Map.html#method.as_local_node_id
126
127
You can’t perform that action at this time.
0 commit comments