about summary refs log tree commit diff
path: root/compiler/rustc_ast_lowering/src/lib.rs
diff options
context:
space:
mode:
authorCamille GILLOT <gillot.camille@gmail.com>2021-09-17 19:41:05 +0200
committerCamille GILLOT <gillot.camille@gmail.com>2021-10-09 14:01:09 +0200
commitcd1ace488fc328ee20397783e3046971e6f09ac5 (patch)
tree78c4a7fd7855b2c9ebf1e22c00ae5a3ff4c2a3c8 /compiler/rustc_ast_lowering/src/lib.rs
parent48a339ddbbc1e1c364d1cb39d3fef8aad9105345 (diff)
downloadrust-cd1ace488fc328ee20397783e3046971e6f09ac5.tar.gz
rust-cd1ace488fc328ee20397783e3046971e6f09ac5.zip
Use an IndexVec for bodies.
Diffstat (limited to 'compiler/rustc_ast_lowering/src/lib.rs')
-rw-r--r--compiler/rustc_ast_lowering/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/compiler/rustc_ast_lowering/src/lib.rs b/compiler/rustc_ast_lowering/src/lib.rs
index 1b82ac68e15..8375a37d32a 100644
--- a/compiler/rustc_ast_lowering/src/lib.rs
+++ b/compiler/rustc_ast_lowering/src/lib.rs
@@ -97,7 +97,7 @@ struct LoweringContext<'a, 'hir: 'a> {
 
     /// The items being lowered are collected here.
     owners: IndexVec<LocalDefId, Option<hir::OwnerInfo<'hir>>>,
-    bodies: BTreeMap<hir::ItemLocalId, hir::Body<'hir>>,
+    bodies: IndexVec<hir::ItemLocalId, Option<&'hir hir::Body<'hir>>>,
     attrs: BTreeMap<hir::ItemLocalId, &'hir [Attribute]>,
 
     generator_kind: Option<hir::GeneratorKind>,
@@ -322,7 +322,7 @@ pub fn lower_crate<'a, 'hir>(
         nt_to_tokenstream,
         arena,
         owners,
-        bodies: BTreeMap::new(),
+        bodies: IndexVec::new(),
         attrs: BTreeMap::default(),
         catch_scope: None,
         loop_scope: None,