]> git.lizzy.rs Git - rust.git/commitdiff
Simplify handling of AllArenas.
authorCamille GILLOT <gillot.camille@gmail.com>
Wed, 27 Nov 2019 12:19:33 +0000 (13:19 +0100)
committerCamille GILLOT <gillot.camille@gmail.com>
Wed, 27 Nov 2019 12:19:33 +0000 (13:19 +0100)
src/librustc_interface/passes.rs
src/librustc_interface/queries.rs

index d2bb2cdfaffacd33a2d9678a4b39bbb20808319f..66666a027c0d54bb7a2067b386f3d2145e86ac60 100644 (file)
@@ -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,
index 581ebe9c00fe1d5f5bde08f24ed629e964905fe3..7e8ba9f270258a2a0948ba04af130b3a173066ac 100644 (file)
@@ -72,9 +72,9 @@ fn default() -> Self {
 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 @@ pub fn new(compiler: &'tcx Compiler) -> 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 @@ pub fn global_ctxt(&'tcx self) -> Result<&Query<QueryContext<'tcx>>> {
                 outputs,
                 &crate_name,
                 &self.gcx,
-                &self.arenas,
+                &self.all_arenas,
                 &self.local_arena,
             ))
         })