From 64f5293956de9dc4e336906f1c7fef8415c292de Mon Sep 17 00:00:00 2001 From: Michael Goulet Date: Thu, 2 Feb 2023 05:49:07 +0000 Subject: Don't cause a cycle when formatting query description that references a FnDef --- compiler/rustc_query_impl/src/plumbing.rs | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'compiler/rustc_query_impl') diff --git a/compiler/rustc_query_impl/src/plumbing.rs b/compiler/rustc_query_impl/src/plumbing.rs index 6125ad4eff1..4dea03c1ef6 100644 --- a/compiler/rustc_query_impl/src/plumbing.rs +++ b/compiler/rustc_query_impl/src/plumbing.rs @@ -314,11 +314,14 @@ pub(crate) fn create_query_frame< kind: DepKind, name: &'static str, ) -> QueryStackFrame { - // Disable visible paths printing for performance reasons. - // Showing visible path instead of any path is not that important in production. - let description = ty::print::with_no_visible_paths!( - // Force filename-line mode to avoid invoking `type_of` query. - ty::print::with_forced_impl_filename_line!(do_describe(tcx.tcx, key)) + // Avoid calling queries while formatting the description + let description = ty::print::with_no_queries!( + // Disable visible paths printing for performance reasons. + // Showing visible path instead of any path is not that important in production. + ty::print::with_no_visible_paths!( + // Force filename-line mode to avoid invoking `type_of` query. + ty::print::with_forced_impl_filename_line!(do_describe(tcx.tcx, key)) + ) ); let description = if tcx.sess.verbose() { format!("{description} [{name:?}]") } else { description }; -- cgit 1.4.1-3-g733a5