about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2023-07-20 03:18:41 +0000
committerbors <bors@rust-lang.org>2023-07-20 03:18:41 +0000
commit0646a5d1aa3745cb448db247f6fa432890a1812b (patch)
treecda4ec7b8ddcda651f3c978ad6814a34267d1125 /compiler
parenta6cdd81eff52566542cecdc1ce381dbe42cf77fb (diff)
parenta903ac5124b8fe8c91b80fe8a6cb16bc784efbd5 (diff)
downloadrust-0646a5d1aa3745cb448db247f6fa432890a1812b.tar.gz
rust-0646a5d1aa3745cb448db247f6fa432890a1812b.zip
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
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_error_codes/src/error_codes/E0391.md3
-rw-r--r--compiler/rustc_query_system/messages.ftl1
-rw-r--r--compiler/rustc_query_system/src/error.rs2
-rw-r--r--compiler/rustc_query_system/src/query/job.rs1
4 files changed, 7 insertions, 0 deletions
diff --git a/compiler/rustc_error_codes/src/error_codes/E0391.md b/compiler/rustc_error_codes/src/error_codes/E0391.md
index dff50ccaa0b..457fbd002a1 100644
--- a/compiler/rustc_error_codes/src/error_codes/E0391.md
+++ b/compiler/rustc_error_codes/src/error_codes/E0391.md
@@ -14,3 +14,6 @@ trait SecondTrait : FirstTrait {
 
 The previous example contains a circular dependency between two traits:
 `FirstTrait` depends on `SecondTrait` which itself depends on `FirstTrait`.
+
+See https://rustc-dev-guide.rust-lang.org/overview.html#queries and
+https://rustc-dev-guide.rust-lang.org/query.html for more information.
diff --git a/compiler/rustc_query_system/messages.ftl b/compiler/rustc_query_system/messages.ftl
index 49b423d1ade..d5fed8fe179 100644
--- a/compiler/rustc_query_system/messages.ftl
+++ b/compiler/rustc_query_system/messages.ftl
@@ -1,4 +1,5 @@
 query_system_cycle = cycle detected when {$stack_bottom}
+    .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
 
 query_system_cycle_recursive_trait_alias = trait aliases cannot be recursive
 
diff --git a/compiler/rustc_query_system/src/error.rs b/compiler/rustc_query_system/src/error.rs
index cf2f04c7486..e49e78cc7c4 100644
--- a/compiler/rustc_query_system/src/error.rs
+++ b/compiler/rustc_query_system/src/error.rs
@@ -57,6 +57,8 @@ pub struct Cycle {
     pub alias: Option<Alias>,
     #[subdiagnostic]
     pub cycle_usage: Option<CycleUsage>,
+    #[note]
+    pub note_span: (),
 }
 
 #[derive(Diagnostic)]
diff --git a/compiler/rustc_query_system/src/query/job.rs b/compiler/rustc_query_system/src/query/job.rs
index e964ba851bd..d2140161f1d 100644
--- a/compiler/rustc_query_system/src/query/job.rs
+++ b/compiler/rustc_query_system/src/query/job.rs
@@ -608,6 +608,7 @@ pub(crate) fn report_cycle<'a, D: DepKind>(
         alias,
         cycle_usage: cycle_usage,
         stack_count,
+        note_span: (),
     };
 
     cycle_diag.into_diagnostic(&sess.parse_sess.span_diagnostic)