about summary refs log tree commit diff
path: root/src/doc/rustc-dev-guide
diff options
context:
space:
mode:
authorSantiago Pastorino <spastorino@gmail.com>2020-10-27 18:34:28 +0000
committerGitHub <noreply@github.com>2020-10-27 19:34:28 +0100
commitb6c5a153bfb084ea556175f0a71b4b35614afe6b (patch)
tree01232edafb1c0c3a943aa4fb62e2f916c61e54c5 /src/doc/rustc-dev-guide
parente6b6363cc082b57f761c964d82eebb09ee5517da (diff)
downloadrust-b6c5a153bfb084ea556175f0a71b4b35614afe6b.tar.gz
rust-b6c5a153bfb084ea556175f0a71b4b35614afe6b.zip
Small improvements (#936)
* Fix typo errros -> errors

* an -> a

* hir -> hir()
Diffstat (limited to 'src/doc/rustc-dev-guide')
-rw-r--r--src/doc/rustc-dev-guide/src/hir.md10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/doc/rustc-dev-guide/src/hir.md b/src/doc/rustc-dev-guide/src/hir.md
index 5757d1e7786..a88ba906665 100644
--- a/src/doc/rustc-dev-guide/src/hir.md
+++ b/src/doc/rustc-dev-guide/src/hir.md
@@ -87,7 +87,7 @@ Most of the time when you are working with the HIR, you will do so via
 the **HIR Map**, accessible in the tcx via [`tcx.hir()`] (and defined in
 the [`hir::map`] module). The [HIR map] contains a [number of methods] to
 convert between IDs of various kinds and to lookup data associated
-with an HIR node.
+with a HIR node.
 
 [`tcx.hir()`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/ty/struct.TyCtxt.html#method.hir
 [`hir::map`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/index.html
@@ -96,7 +96,7 @@ with an HIR node.
 
 For example, if you have a [`DefId`], and you would like to convert it
 to a [`NodeId`], you can use
-[`tcx.hir.as_local_node_id(def_id)`][as_local_node_id]. This returns
+[`tcx.hir().as_local_node_id(def_id)`][as_local_node_id]. This returns
 an `Option<NodeId>` – this will be `None` if the def-id refers to
 something outside of the current crate (since then it has no HIR
 node), but otherwise returns `Some(n)` where `n` is the node-id of the
@@ -105,13 +105,13 @@ definition.
 [`NodeId`]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_ast/node_id/struct.NodeId.html
 [as_local_node_id]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.as_local_node_id
 
-Similarly, you can use [`tcx.hir.find(n)`][find] to lookup the node for a
+Similarly, you can use [`tcx.hir().find(n)`][find] to lookup the node for a
 [`NodeId`]. This returns a `Option<Node<'tcx>>`, where [`Node`] is an enum
 defined in the map; by matching on this you can find out what sort of
 node the node-id referred to and also get a pointer to the data
 itself. Often, you know what sort of node `n` is – e.g. if you know
 that `n` must be some HIR expression, you can do
-[`tcx.hir.expect_expr(n)`][expect_expr], which will extract and return the
+[`tcx.hir().expect_expr(n)`][expect_expr], which will extract and return the
 [`&hir::Expr`][Expr], panicking if `n` is not in fact an expression.
 
 [find]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.find
@@ -120,7 +120,7 @@ that `n` must be some HIR expression, you can do
 [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
-calls like [`tcx.hir.get_parent_node(n)`][get_parent_node].
+calls like [`tcx.hir().get_parent_node(n)`][get_parent_node].
 
 [get_parent_node]: https://doc.rust-lang.org/nightly/nightly-rustc/rustc_middle/hir/map/struct.Map.html#method.get_parent_node