about summary refs log tree commit diff
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-09-24 21:15:59 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2021-10-14 22:59:30 +0200
commit1e2dbb5f4a80077cb4b036b6f4ff96c96ad89805 (patch)
tree199ceb02a588bd861d6000d155e8e2fdabf180c0
parent394f7198cad038594a9a4e4ed652170d3cdf42f6 (diff)
downloadrust-1e2dbb5f4a80077cb4b036b6f4ff96c96ad89805.tar.gz
rust-1e2dbb5f4a80077cb4b036b6f4ff96c96ad89805.zip
Document structs.
-rw-r--r--compiler/rustc_hir/src/hir.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_hir/src/hir.rs b/compiler/rustc_hir/src/hir.rs
index 1ec37566fab..ddda73b91c9 100644
--- a/compiler/rustc_hir/src/hir.rs
+++ b/compiler/rustc_hir/src/hir.rs
@@ -672,7 +672,7 @@ pub struct ParentedNode<'tcx> {
     pub node: Node<'tcx>,
 }
 
-/// Attributes owner by a HIR owner.
+/// Attributes owned by a HIR owner.
 #[derive(Debug)]
 pub struct AttributeMap<'tcx> {
     pub map: BTreeMap<ItemLocalId, &'tcx [Attribute]>,
@@ -689,6 +689,9 @@ impl<'tcx> AttributeMap<'tcx> {
     }
 }
 
+/// Map of all HIR nodes inside the current owner.
+/// These nodes are mapped by `ItemLocalId` alongside the index of their parent node.
+/// The HIR tree, including bodies, is pre-hashed.
 #[derive(Debug)]
 pub struct OwnerNodes<'tcx> {
     /// Pre-computed hash of the full HIR.
@@ -704,6 +707,7 @@ pub struct OwnerNodes<'tcx> {
     pub bodies: IndexVec<ItemLocalId, Option<&'tcx Body<'tcx>>>,
 }
 
+/// Full information resulting from lowering an AST node.
 #[derive(Debug, HashStable_Generic)]
 pub struct OwnerInfo<'hir> {
     /// Contents of the HIR.