Simplify handling of AllArenas.
This commit is contained in:
parent
e5ed101098
commit
77a4c85e54
@ -764,7 +764,7 @@ pub fn create_global_ctxt<'tcx>(
|
||||
outputs: OutputFilenames,
|
||||
crate_name: &str,
|
||||
global_ctxt: &'tcx Once<GlobalCtxt<'tcx>>,
|
||||
arenas: &'tcx Once<AllArenas>,
|
||||
all_arenas: &'tcx AllArenas,
|
||||
local_arena: &'tcx WorkerLocal<Arena<'tcx>>,
|
||||
) -> QueryContext<'tcx> {
|
||||
let sess = &compiler.session();
|
||||
@ -793,13 +793,12 @@ pub fn create_global_ctxt<'tcx>(
|
||||
callback(sess, &mut local_providers, &mut extern_providers);
|
||||
}
|
||||
|
||||
let arenas = arenas.init_locking(|| AllArenas::new());
|
||||
let gcx = global_ctxt.init_locking(|| TyCtxt::create_global_ctxt(
|
||||
sess,
|
||||
lint_store,
|
||||
local_providers,
|
||||
extern_providers,
|
||||
&arenas,
|
||||
&all_arenas,
|
||||
local_arena,
|
||||
resolver_outputs,
|
||||
hir_map,
|
||||
|
@ -72,9 +72,9 @@ impl<T> Default for Query<T> {
|
||||
pub struct Queries<'tcx> {
|
||||
compiler: &'tcx Compiler,
|
||||
gcx: Once<GlobalCtxt<'tcx>>,
|
||||
arenas: Once<AllArenas>,
|
||||
forest: Once<hir::map::Forest>,
|
||||
|
||||
all_arenas: AllArenas,
|
||||
local_arena: WorkerLocal<Arena<'tcx>>,
|
||||
|
||||
dep_graph_future: Query<Option<DepGraphFuture>>,
|
||||
@ -94,8 +94,8 @@ impl<'tcx> Queries<'tcx> {
|
||||
Queries {
|
||||
compiler,
|
||||
gcx: Once::new(),
|
||||
arenas: Once::new(),
|
||||
forest: Once::new(),
|
||||
all_arenas: AllArenas::new(),
|
||||
local_arena: WorkerLocal::new(|_| Arena::default()),
|
||||
dep_graph_future: Default::default(),
|
||||
parse: Default::default(),
|
||||
@ -268,7 +268,7 @@ impl<'tcx> Queries<'tcx> {
|
||||
outputs,
|
||||
&crate_name,
|
||||
&self.gcx,
|
||||
&self.arenas,
|
||||
&self.all_arenas,
|
||||
&self.local_arena,
|
||||
))
|
||||
})
|
||||
|
Loading…
x
Reference in New Issue
Block a user