diff options
| author | Camille GILLOT <gillot.camille@gmail.com> | 2020-11-29 00:39:34 +0100 |
|---|---|---|
| committer | Camille GILLOT <gillot.camille@gmail.com> | 2021-02-20 23:40:56 +0100 |
| commit | a87de890fd1a797952ab49459aeca4ce598d8f15 (patch) | |
| tree | 5be960f5c6ce24faeef7c70752222ea8746fc8fe /compiler/rustc_query_impl/src | |
| parent | c26d965714e38d62b1610780f67bec14dafe25c3 (diff) | |
| download | rust-a87de890fd1a797952ab49459aeca4ce598d8f15.tar.gz rust-a87de890fd1a797952ab49459aeca4ce598d8f15.zip | |
Move print_query_stack to rustc_query_system.
Diffstat (limited to 'compiler/rustc_query_impl/src')
| -rw-r--r-- | compiler/rustc_query_impl/src/lib.rs | 2 | ||||
| -rw-r--r-- | compiler/rustc_query_impl/src/plumbing.rs | 34 |
2 files changed, 3 insertions, 33 deletions
diff --git a/compiler/rustc_query_impl/src/lib.rs b/compiler/rustc_query_impl/src/lib.rs index 176c68cf0fc..e9314797fbd 100644 --- a/compiler/rustc_query_impl/src/lib.rs +++ b/compiler/rustc_query_impl/src/lib.rs @@ -18,7 +18,7 @@ extern crate tracing; use rustc_data_structures::fingerprint::Fingerprint; use rustc_data_structures::stable_hasher::{HashStable, StableHasher}; -use rustc_errors::{Diagnostic, DiagnosticBuilder, Handler, Level}; +use rustc_errors::{DiagnosticBuilder, Handler}; use rustc_hir::def_id::CrateNum; use rustc_index::vec::IndexVec; use rustc_middle::dep_graph; diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index 00392fbcf56..4618671ddf0 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -584,38 +584,8 @@ macro_rules! define_queries_struct { handler: &Handler, num_frames: Option<usize>, ) -> usize { - let query_map = self.try_collect_active_jobs(tcx); - - let mut current_query = query; - let mut i = 0; - - while let Some(query) = current_query { - if Some(i) == num_frames { - break; - } - let query_info = if let Some(info) = query_map.as_ref().and_then(|map| map.get(&query)) - { - info - } else { - break; - }; - let mut diag = Diagnostic::new( - Level::FailureNote, - &format!( - "#{} [{}] {}", - i, - query_info.info.query.name, - query_info.info.query.description, - ), - ); - diag.span = tcx.sess.source_map().guess_head_span(query_info.info.span).into(); - handler.force_print_diagnostic(diag); - - current_query = query_info.job.parent; - i += 1; - } - - i + let qcx = QueryCtxt { tcx, queries: self }; + rustc_query_system::query::print_query_stack(qcx, query, handler, num_frames) } $($(#[$attr])* |
