diff options
| author | Ralf Jung <post@ralfj.de> | 2019-11-29 22:57:34 +0100 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-11-29 22:57:34 +0100 |
| commit | 6ea1df234016590ee932a89b7c5a78b905dcf71a (patch) | |
| tree | 47bedbd9aec458db1e8d5a3007fe503f8dede277 /src/librustc/ty | |
| parent | 56203be06f3671ce73d5634bf5c098eb3b8b1c1c (diff) | |
| parent | 1e12f39d83eeddd523e384e20ab4f1fa56eb8888 (diff) | |
| download | rust-6ea1df234016590ee932a89b7c5a78b905dcf71a.tar.gz rust-6ea1df234016590ee932a89b7c5a78b905dcf71a.zip | |
Rollup merge of #66791 - cjgillot:arena, r=Mark-Simulacrum
Handle GlobalCtxt directly from librustc_interface query system This PR constructs the `GlobalCtxt` as a member of the `Queries` in librustc_interface. This simplifies the code to construct it, at the expense of added complexity in the query control flow. This allows to handle the arenas directly from librustc_interface. Based on #66707 r? @Zoxc
Diffstat (limited to 'src/librustc/ty')
| -rw-r--r-- | src/librustc/ty/context.rs | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/librustc/ty/context.rs b/src/librustc/ty/context.rs index 5a7078cdb26..0b6937975aa 100644 --- a/src/librustc/ty/context.rs +++ b/src/librustc/ty/context.rs @@ -995,7 +995,7 @@ impl<'tcx> Deref for TyCtxt<'tcx> { } pub struct GlobalCtxt<'tcx> { - pub arena: WorkerLocal<Arena<'tcx>>, + pub arena: &'tcx WorkerLocal<Arena<'tcx>>, interners: CtxtInterners<'tcx>, @@ -1170,6 +1170,7 @@ impl<'tcx> TyCtxt<'tcx> { local_providers: ty::query::Providers<'tcx>, extern_providers: ty::query::Providers<'tcx>, arenas: &'tcx AllArenas, + arena: &'tcx WorkerLocal<Arena<'tcx>>, resolutions: ty::ResolverOutputs, hir: hir_map::Map<'tcx>, on_disk_query_result_cache: query::OnDiskCache<'tcx>, @@ -1225,7 +1226,7 @@ impl<'tcx> TyCtxt<'tcx> { sess: s, lint_store, cstore, - arena: WorkerLocal::new(|_| Arena::default()), + arena, interners, dep_graph, prof: s.prof.clone(), |
