From 0efeec580a9cfa426e965af35747cef74d19191c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20K=C3=BCber?= Date: Sun, 28 Sep 2025 23:04:50 +0000 Subject: [PATCH] Mention crate being analysized in query description "running analysis passes on this crate" -> "running analysis passes on crate `foo`" This message is displayed in cycle errors in particular, and in some cases without any spans or any other identifiable information to determine which dependency introduced the cycle. --- compiler/rustc_middle/src/query/mod.rs | 5 ++++- .../issue-24949-assoc-const-static-recursion-trait.stderr | 2 +- tests/ui/consts/const-eval/const-eval-query-stack.stderr | 2 +- tests/ui/consts/recursive-zst-static.default.stderr | 2 +- tests/ui/consts/recursive-zst-static.unleash.stderr | 2 +- tests/ui/track-diagnostics/track.stderr | 2 +- tests/ui/treat-err-as-bug/err.stderr | 2 +- 7 files changed, 10 insertions(+), 7 deletions(-) diff --git a/compiler/rustc_middle/src/query/mod.rs b/compiler/rustc_middle/src/query/mod.rs index 30d4cc8b3c8d6..db2e252f9406a 100644 --- a/compiler/rustc_middle/src/query/mod.rs +++ b/compiler/rustc_middle/src/query/mod.rs @@ -397,7 +397,10 @@ rustc_queries! { /// The root query triggering all analysis passes like typeck or borrowck. query analysis(key: ()) { eval_always - desc { "running analysis passes on this crate" } + desc { |tcx| + "running analysis passes on crate `{}`", + tcx.crate_name(LOCAL_CRATE), + } } /// This query checks the fulfillment of collected lint expectations. diff --git a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr index 317af7975aa7e..8197cfcba5025 100644 --- a/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr +++ b/tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr @@ -30,7 +30,7 @@ note: ...which requires elaborating drops for `