Skip to content

Commit 0646a5d

Browse files
committed
Auto merge of #113622 - RickleAndMortimer:issue-113184-fix, r=oli-obk
add links to query documentation for E0391 This PR adds links to https://rustc-dev-guide.rust-lang.org/overview.html#queries and https://rustc-dev-guide.rust-lang.org/query.html for the rustc --explain E0391 and within the compiler error itself. Fixes: #113184
2 parents a6cdd81 + a903ac5 commit 0646a5d

File tree

52 files changed

+62
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

52 files changed

+62
-0
lines changed

compiler/rustc_error_codes/src/error_codes/E0391.md

Lines changed: 3 additions & 0 deletions

compiler/rustc_query_system/messages.ftl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
query_system_cycle = cycle detected when {$stack_bottom}
2+
.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
23
34
query_system_cycle_recursive_trait_alias = trait aliases cannot be recursive
45

compiler/rustc_query_system/src/error.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,8 @@ pub struct Cycle {
5757
pub alias: Option<Alias>,
5858
#[subdiagnostic]
5959
pub cycle_usage: Option<CycleUsage>,
60+
#[note]
61+
pub note_span: (),
6062
}
6163

6264
#[derive(Diagnostic)]

compiler/rustc_query_system/src/query/job.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -608,6 +608,7 @@ pub(crate) fn report_cycle<'a, D: DepKind>(
608608
alias,
609609
cycle_usage: cycle_usage,
610610
stack_count,
611+
note_span: (),
611612
};
612613

613614
cycle_diag.into_diagnostic(&sess.parse_sess.span_diagnostic)

src/tools/miri/tests/fail/layout_cycle.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ error[E0391]: cycle detected when computing layout of `S<S<()>>`
22
|
33
= note: ...which requires computing layout of `<S<()> as Tr>::I`...
44
= note: ...which again requires computing layout of `S<S<()>>`, completing the cycle
5+
= 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
56

67
error: post-monomorphization error: a cycle occurred during layout computation
78
--> RUSTLIB/core/src/mem/mod.rs:LL:CC

tests/rustdoc-ui/issue-110629-private-type-cycle-dyn.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ LL | | fn bar<'a, 'b>(i: &'a i32) -> Bar<'a, 'b> {
1919
LL | | assert!(bar(&meh) == bar(&muh));
2020
LL | | }
2121
| |_^
22+
= 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
2223

2324
error: aborting due to previous error
2425

tests/ui/associated-consts/defaults-cyclic-fail.stderr

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ note: cycle used when const-evaluating + checking `main::promoted[1]`
1515
|
1616
LL | assert_eq!(<() as Tr>::A, 0);
1717
| ^^^^^^^^^^^^^
18+
= 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
1819

1920
error: aborting due to previous error
2021

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ LL | const BAR: u32 = IMPL_REF_BAR;
2626
| ^^^^^^^^^^^^^^
2727
= note: ...which again requires elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-impl.rs:11:1: 11:19>::BAR`, completing the cycle
2828
= note: cycle used when running analysis passes on this crate
29+
= 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
2930

3031
error: aborting due to previous error
3132

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ LL | const BAR: u32 = DEFAULT_REF_BAR;
2626
| ^^^^^^^^^^^^^^
2727
= note: ...which again requires elaborating drops for `FooDefault::BAR`, completing the cycle
2828
= note: cycle used when running analysis passes on this crate
29+
= 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
2930

3031
error: aborting due to previous error
3132

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ LL | const BAR: u32 = TRAIT_REF_BAR;
2626
| ^^^^^^^^^^^^^^
2727
= note: ...which again requires elaborating drops for `<impl at $DIR/issue-24949-assoc-const-static-recursion-trait.rs:11:1: 11:28>::BAR`, completing the cycle
2828
= note: cycle used when running analysis passes on this crate
29+
= 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
2930

3031
error: aborting due to previous error
3132

0 commit comments

Comments
 (0)