Skip to content

Commit 9758973

Browse files
authored
Rollup merge of #147137 - estebank:issue-74380, r=nnethercote
Mention crate being analyzed 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. Address #74380, but we still need a test for that case in particular.
2 parents 73e6c9e + 0efeec5 commit 9758973

File tree

7 files changed

+10
-7
lines changed

7 files changed

+10
-7
lines changed

compiler/rustc_middle/src/query/mod.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -397,7 +397,10 @@ rustc_queries! {
397397
/// The root query triggering all analysis passes like typeck or borrowck.
398398
query analysis(key: ()) {
399399
eval_always
400-
desc { "running analysis passes on this crate" }
400+
desc { |tcx|
401+
"running analysis passes on crate `{}`",
402+
tcx.crate_name(LOCAL_CRATE),
403+
}
401404
}
402405

403406
/// This query checks the fulfillment of collected lint expectations.

tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-trait.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ note: ...which requires elaborating drops for `<impl at $DIR/issue-24949-assoc-c
3030
LL | const BAR: u32 = TRAIT_REF_BAR;
3131
| ^^^^^^^^^^^^^
3232
= note: ...which again requires simplifying constant for the type system `TRAIT_REF_BAR`, completing the cycle
33-
= note: cycle used when running analysis passes on this crate
33+
= note: cycle used when running analysis passes on crate `issue_24949_assoc_const_static_recursion_trait`
3434
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
3535

3636
error: aborting due to 1 previous error

tests/ui/consts/const-eval/const-eval-query-stack.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,5 +10,5 @@ note: please make sure that you have updated to the latest nightly
1010
query stack during panic:
1111
#0 [eval_to_allocation_raw] const-evaluating + checking `X`
1212
#1 [eval_to_const_value_raw] simplifying constant for the type system `X`
13-
#2 [analysis] running analysis passes on this crate
13+
#2 [analysis] running analysis passes on crate `const_eval_query_stack`
1414
end of query stack

tests/ui/consts/recursive-zst-static.default.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ note: ...which requires evaluating initializer of static `B`...
1616
LL | static B: () = A;
1717
| ^^^^^^^^^^^^
1818
= note: ...which again requires evaluating initializer of static `A`, completing the cycle
19-
= note: cycle used when running analysis passes on this crate
19+
= note: cycle used when running analysis passes on crate `recursive_zst_static`
2020
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
2121

2222
error: aborting due to 2 previous errors

tests/ui/consts/recursive-zst-static.unleash.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ note: ...which requires evaluating initializer of static `B`...
1616
LL | static B: () = A;
1717
| ^^^^^^^^^^^^
1818
= note: ...which again requires evaluating initializer of static `A`, completing the cycle
19-
= note: cycle used when running analysis passes on this crate
19+
= note: cycle used when running analysis passes on crate `recursive_zst_static`
2020
= note: see https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for more information
2121

2222
error: aborting due to 2 previous errors

tests/ui/track-diagnostics/track.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ note: compiler flags: ... -Z ui-testing ... -Z track-diagnostics
4141

4242
query stack during panic:
4343
#0 [typeck] type-checking `main`
44-
#1 [analysis] running analysis passes on this crate
44+
#1 [analysis] running analysis passes on crate `track`
4545
end of query stack
4646
error: aborting due to 3 previous errors
4747

tests/ui/treat-err-as-bug/err.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,5 +9,5 @@ error: the compiler unexpectedly panicked. this is a bug.
99

1010
query stack during panic:
1111
#0 [eval_static_initializer] evaluating initializer of static `C`
12-
#1 [analysis] running analysis passes on this crate
12+
#1 [analysis] running analysis passes on crate `err`
1313
end of query stack

0 commit comments

Comments
 (0)