diff options
| author | Michael Goulet <michael@errs.io> | 2023-02-02 05:49:07 +0000 |
|---|---|---|
| committer | Michael Goulet <michael@errs.io> | 2023-02-02 05:49:07 +0000 |
| commit | 64f5293956de9dc4e336906f1c7fef8415c292de (patch) | |
| tree | 651da7a9c3486c1bc2c0df170d26604bbcd9dd27 /compiler/rustc_query_impl/src | |
| parent | e63ec2e1402eaff949e5c53b8f6062b152010fcc (diff) | |
| download | rust-64f5293956de9dc4e336906f1c7fef8415c292de.tar.gz rust-64f5293956de9dc4e336906f1c7fef8415c292de.zip | |
Don't cause a cycle when formatting query description that references a FnDef
Diffstat (limited to 'compiler/rustc_query_impl/src')
| -rw-r--r-- | compiler/rustc_query_impl/src/plumbing.rs | 13 |
1 files changed, 8 insertions, 5 deletions
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<DepKind> { - // 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 }; |
