From 0144d6a3b7e2f2bba4c7cc9adc04c2b6e4e01b93 Mon Sep 17 00:00:00 2001 From: Camille GILLOT Date: Sat, 26 Dec 2020 16:36:55 +0100 Subject: Do not hold query key in Query. --- compiler/rustc_query_system/src/query/config.rs | 4 +++- compiler/rustc_query_system/src/query/plumbing.rs | 7 ++++--- 2 files changed, 7 insertions(+), 4 deletions(-) (limited to 'compiler/rustc_query_system/src/query') diff --git a/compiler/rustc_query_system/src/query/config.rs b/compiler/rustc_query_system/src/query/config.rs index 3873b47d4d4..8239f347923 100644 --- a/compiler/rustc_query_system/src/query/config.rs +++ b/compiler/rustc_query_system/src/query/config.rs @@ -73,7 +73,9 @@ pub trait QueryAccessors: QueryConfig { type Cache: QueryCache; // Don't use this method to access query results, instead use the methods on TyCtxt - fn query_state<'a>(tcx: CTX) -> &'a QueryState; + fn query_state<'a>(tcx: CTX) -> &'a QueryState + where + CTX: 'a; // Don't use this method to access query results, instead use the methods on TyCtxt fn query_cache<'a>(tcx: CTX) -> &'a QueryCacheStore diff --git a/compiler/rustc_query_system/src/query/plumbing.rs b/compiler/rustc_query_system/src/query/plumbing.rs index fdc73dcc540..dbe7c4c2320 100644 --- a/compiler/rustc_query_system/src/query/plumbing.rs +++ b/compiler/rustc_query_system/src/query/plumbing.rs @@ -119,10 +119,11 @@ where shards.iter().all(|shard| shard.active.is_empty()) } - pub fn try_collect_active_jobs( + pub fn try_collect_active_jobs( &self, + tcx: CTX, kind: D, - make_query: fn(K) -> Q, + make_query: fn(CTX, K) -> Q, jobs: &mut QueryMap, ) -> Option<()> { // We use try_lock_shards here since we are called from the @@ -133,7 +134,7 @@ where shard.active.iter().filter_map(move |(k, v)| { if let QueryResult::Started(ref job) = *v { let id = QueryJobId::new(job.id, shard_id, kind); - let info = QueryInfo { span: job.span, query: make_query(k.clone()) }; + let info = QueryInfo { span: job.span, query: make_query(tcx, k.clone()) }; Some((id, QueryJobInfo { info, job: job.clone() })) } else { None -- cgit 1.4.1-3-g733a5