diff --git a/compiler/rustc_query_system/src/query/job.rs b/compiler/rustc_query_system/src/query/job.rs index 63a8f0624759c842908ba800ef81f871849cd6fc..c3fdf4fc228511b0ebc767267f052461f681196a 100644 --- a/compiler/rustc_query_system/src/query/job.rs +++ b/compiler/rustc_query_system/src/query/job.rs @@ -61,7 +61,7 @@ pub fn new(job: QueryShardJobId, shard: usize, kind: D) -> Self { } fn query(self, map: &QueryMap) -> QueryStackFrame { - map.get(&self).unwrap().info.query.clone() + map.get(&self).unwrap().query.clone() } #[cfg(parallel_compiler)] @@ -81,7 +81,7 @@ fn latch<'a>(self, map: &'a QueryMap) -> Option<&'a QueryLatch> { } pub struct QueryJobInfo { - pub info: QueryInfo, + pub query: QueryStackFrame, pub job: QueryJob, } @@ -155,7 +155,7 @@ pub(super) fn find_cycle_in_stack( while let Some(job) = current_job { let info = query_map.get(&job).unwrap(); - cycle.push(info.info.clone()); + cycle.push(QueryInfo { span: info.job.span, query: info.query.clone() }); if job == *self { cycle.reverse(); @@ -170,7 +170,7 @@ pub(super) fn find_cycle_in_stack( .job .parent .as_ref() - .map(|parent| (info.info.span, parent.query(&query_map))); + .map(|parent| (info.job.span, parent.query(&query_map))); return CycleError { usage, cycle }; } @@ -649,13 +649,10 @@ pub fn print_query_stack( }; let mut diag = Diagnostic::new( Level::FailureNote, - &format!( - "#{} [{}] {}", - i, query_info.info.query.name, query_info.info.query.description - ), + &format!("#{} [{}] {}", i, query_info.query.name, query_info.query.description), ); diag.span = - tcx.dep_context().sess().source_map().guess_head_span(query_info.info.span).into(); + tcx.dep_context().sess().source_map().guess_head_span(query_info.job.span).into(); handler.force_print_diagnostic(diag); current_query = query_info.job.parent; diff --git a/compiler/rustc_query_system/src/query/plumbing.rs b/compiler/rustc_query_system/src/query/plumbing.rs index a7511846cadb61abc218b1278a9ecd62bd27a8cf..3f22de6fba4077987d673cb21dfe8a4fea89b830 100644 --- a/compiler/rustc_query_system/src/query/plumbing.rs +++ b/compiler/rustc_query_system/src/query/plumbing.rs @@ -130,8 +130,8 @@ pub fn try_collect_active_jobs( for (k, v) in shard.active.iter() { 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(tcx, k.clone()) }; - jobs.insert(id, QueryJobInfo { info, job: job.clone() }); + let query = make_query(tcx, k.clone()); + jobs.insert(id, QueryJobInfo { query, job: job.clone() }); } } }