]> git.lizzy.rs Git - rust.git/blobdiff - compiler/rustc_query_system/src/error.rs
Rollup merge of #102081 - andrewpollack:add-execvp-calls-ignore, r=tmandry
[rust.git] / compiler / rustc_query_system / src / error.rs
index 3fb06cbedbd507f6f5d0d04f684d8fc418553518..8602a4cf5aef2ec236126215a5025c44fa6ffeb5 100644 (file)
@@ -1,12 +1,14 @@
-use rustc_errors::AddSubdiagnostic;
-use rustc_span::Span;
+use rustc_errors::AddToDiagnostic;
+use rustc_macros::{Diagnostic, Subdiagnostic};
+use rustc_session::Limit;
+use rustc_span::{Span, Symbol};
 
 pub struct CycleStack {
     pub span: Span,
     pub desc: String,
 }
 
-impl AddSubdiagnostic for CycleStack {
+impl AddToDiagnostic for CycleStack {
     fn add_to_diagnostic(self, diag: &mut rustc_errors::Diagnostic) {
         diag.span_note(self.span, &format!("...which requires {}...", self.desc));
     }
@@ -19,7 +21,7 @@ pub enum HandleCycleError {
     DelayBug,
 }
 
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
 pub enum StackCount {
     #[note(query_system::cycle_stack_single)]
     Single,
@@ -27,7 +29,7 @@ pub enum StackCount {
     Multiple,
 }
 
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
 pub enum Alias {
     #[note(query_system::cycle_recursive_ty_alias)]
     #[help(query_system::cycle_recursive_ty_alias_help1)]
@@ -37,7 +39,7 @@ pub enum Alias {
     Trait,
 }
 
-#[derive(SessionSubdiagnostic)]
+#[derive(Subdiagnostic)]
 #[note(query_system::cycle_usage)]
 pub struct CycleUsage {
     #[primary_span]
@@ -45,7 +47,7 @@ pub struct CycleUsage {
     pub usage: String,
 }
 
-#[derive(SessionDiagnostic)]
+#[derive(Diagnostic)]
 #[diag(query_system::cycle, code = "E0391")]
 pub struct Cycle {
     #[primary_span]
@@ -61,11 +63,11 @@ pub struct Cycle {
     pub cycle_usage: Option<CycleUsage>,
 }
 
-#[derive(SessionDiagnostic)]
+#[derive(Diagnostic)]
 #[diag(query_system::reentrant)]
 pub struct Reentrant;
 
-#[derive(SessionDiagnostic)]
+#[derive(Diagnostic)]
 #[diag(query_system::increment_compilation)]
 #[help]
 #[note(query_system::increment_compilation_note1)]
@@ -75,6 +77,21 @@ pub struct IncrementCompilation {
     pub dep_node: String,
 }
 
-#[derive(SessionDiagnostic)]
+#[derive(Diagnostic)]
+#[help]
 #[diag(query_system::query_overflow)]
-pub struct QueryOverflow;
+pub struct QueryOverflow {
+    #[primary_span]
+    pub span: Option<Span>,
+    #[subdiagnostic]
+    pub layout_of_depth: Option<LayoutOfDepth>,
+    pub suggested_limit: Limit,
+    pub crate_name: Symbol,
+}
+
+#[derive(Subdiagnostic)]
+#[note(query_system::layout_of_depth)]
+pub struct LayoutOfDepth {
+    pub desc: String,
+    pub depth: usize,
+}