Skip to content

Commit 1e12f39

Browse files
committed
Allocate HIR Forest on arena.
1 parent e321ba9 commit 1e12f39

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/librustc/arena.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -93,6 +93,7 @@ macro_rules! arena_types {
9393
rustc::hir::def_id::CrateNum
9494
>
9595
>,
96+
[few] hir_forest: rustc::hir::map::Forest,
9697
[few] diagnostic_items: rustc_data_structures::fx::FxHashMap<
9798
syntax::symbol::Symbol,
9899
rustc::hir::def_id::DefId,

src/librustc_interface/queries.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,6 @@ impl<T> Default for Query<T> {
7272
pub struct Queries<'tcx> {
7373
compiler: &'tcx Compiler,
7474
gcx: Once<GlobalCtxt<'tcx>>,
75-
forest: Once<hir::map::Forest>,
7675

7776
all_arenas: AllArenas,
7877
arena: WorkerLocal<Arena<'tcx>>,
@@ -94,7 +93,6 @@ impl<'tcx> Queries<'tcx> {
9493
Queries {
9594
compiler,
9695
gcx: Once::new(),
97-
forest: Once::new(),
9896
all_arenas: AllArenas::new(),
9997
arena: WorkerLocal::new(|_| Arena::default()),
10098
dep_graph_future: Default::default(),
@@ -236,7 +234,7 @@ impl<'tcx> Queries<'tcx> {
236234
&krate
237235
)
238236
})?;
239-
let hir = self.forest.init_locking(|| hir);
237+
let hir = self.arena.alloc(hir);
240238
Ok((hir, Steal::new(BoxedResolver::to_resolver_outputs(resolver))))
241239
})
242240
}

0 commit comments

Comments
 (0)