Allocate HIR Forest on arena.
This commit is contained in:
parent
e321ba989c
commit
1e12f39d83
@ -93,6 +93,7 @@ macro_rules! arena_types {
|
||||
rustc::hir::def_id::CrateNum
|
||||
>
|
||||
>,
|
||||
[few] hir_forest: rustc::hir::map::Forest,
|
||||
[few] diagnostic_items: rustc_data_structures::fx::FxHashMap<
|
||||
syntax::symbol::Symbol,
|
||||
rustc::hir::def_id::DefId,
|
||||
|
@ -72,7 +72,6 @@ fn default() -> Self {
|
||||
pub struct Queries<'tcx> {
|
||||
compiler: &'tcx Compiler,
|
||||
gcx: Once<GlobalCtxt<'tcx>>,
|
||||
forest: Once<hir::map::Forest>,
|
||||
|
||||
all_arenas: AllArenas,
|
||||
arena: WorkerLocal<Arena<'tcx>>,
|
||||
@ -94,7 +93,6 @@ pub fn new(compiler: &'tcx Compiler) -> Queries<'tcx> {
|
||||
Queries {
|
||||
compiler,
|
||||
gcx: Once::new(),
|
||||
forest: Once::new(),
|
||||
all_arenas: AllArenas::new(),
|
||||
arena: WorkerLocal::new(|_| Arena::default()),
|
||||
dep_graph_future: Default::default(),
|
||||
@ -236,7 +234,7 @@ pub fn lower_to_hir(
|
||||
&krate
|
||||
)
|
||||
})?;
|
||||
let hir = self.forest.init_locking(|| hir);
|
||||
let hir = self.arena.alloc(hir);
|
||||
Ok((hir, Steal::new(BoxedResolver::to_resolver_outputs(resolver))))
|
||||
})
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user