Skip to content

Commit be8f1aa

Browse files
committed
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.
1 parent 8d72d3e commit be8f1aa

File tree

11 files changed

+15
-13
lines changed

11 files changed

+15
-13
lines changed

compiler/rustc_middle/src/query/mod.rs

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

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

tests/ui/associated-consts/issue-24949-assoc-const-static-recursion-impl.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 = IMPL_REF_BAR;
3131
| ^^^^^^^^^^^^
3232
= note: ...which again requires simplifying constant for the type system `IMPL_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_impl`
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/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/issues/issue-17252.stderr

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ note: ...which requires const-evaluating + checking `FOO`...
1010
LL | const FOO: usize = FOO;
1111
| ^^^
1212
= note: ...which again requires simplifying constant for the type system `FOO`, completing the cycle
13-
= note: cycle used when running analysis passes on this crate
13+
= note: cycle used when running analysis passes on crate `issue_17252`
1414
= 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
1515

1616
error[E0391]: cycle detected when simplifying constant for the type system `main::BAR`
@@ -25,7 +25,7 @@ note: ...which requires const-evaluating + checking `main::BAR`...
2525
LL | const BAR: usize = BAR;
2626
| ^^^
2727
= note: ...which again requires simplifying constant for the type system `main::BAR`, completing the cycle
28-
= note: cycle used when running analysis passes on this crate
28+
= note: cycle used when running analysis passes on crate `issue_17252`
2929
= 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
3030

3131
error: aborting due to 2 previous errors

tests/ui/parallel-rustc/cycle_crash-issue-135870.stderr

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@ note: ...which requires const-evaluating + checking `FOO`...
1010
LL | const FOO: usize = FOO;
1111
| ^^^
1212
= note: ...which again requires simplifying constant for the type system `FOO`, completing the cycle
13-
= note: cycle used when running analysis passes on this crate
1413
= 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
1514

1615
error: aborting due to 1 previous error
1716

18-
For more information about this error, try `rustc --explain E0391`.
17+
For more information about this error, try `rustc --explain E0391`.

tests/ui/recursion/issue-23302-3.stderr

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ note: ...which requires const-evaluating + checking `B`...
2020
LL | const B: i32 = A;
2121
| ^
2222
= note: ...which again requires simplifying constant for the type system `A`, completing the cycle
23-
= note: cycle used when running analysis passes on this crate
23+
= note: cycle used when running analysis passes on crate `issue_23302_3`
2424
= 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
2525

2626
error: aborting due to 1 previous error

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

0 commit comments

Comments
 (0)