1 use rustc_errors::AddSubdiagnostic;
2 use rustc_session::Limit;
3 use rustc_span::{Span, Symbol};
5 pub struct CycleStack {
10 impl AddSubdiagnostic for CycleStack {
11 fn add_to_diagnostic(self, diag: &mut rustc_errors::Diagnostic) {
12 diag.span_note(self.span, &format!("...which requires {}...", self.desc));
16 #[derive(Copy, Clone)]
17 pub enum HandleCycleError {
23 #[derive(SessionSubdiagnostic)]
25 #[note(query_system::cycle_stack_single)]
27 #[note(query_system::cycle_stack_multiple)]
31 #[derive(SessionSubdiagnostic)]
33 #[note(query_system::cycle_recursive_ty_alias)]
34 #[help(query_system::cycle_recursive_ty_alias_help1)]
35 #[help(query_system::cycle_recursive_ty_alias_help2)]
37 #[note(query_system::cycle_recursive_trait_alias)]
41 #[derive(SessionSubdiagnostic)]
42 #[note(query_system::cycle_usage)]
43 pub struct CycleUsage {
49 #[derive(SessionDiagnostic)]
50 #[diag(query_system::cycle, code = "E0391")]
54 pub stack_bottom: String,
56 pub cycle_stack: Vec<CycleStack>,
58 pub stack_count: StackCount,
60 pub alias: Option<Alias>,
62 pub cycle_usage: Option<CycleUsage>,
65 #[derive(SessionDiagnostic)]
66 #[diag(query_system::reentrant)]
69 #[derive(SessionDiagnostic)]
70 #[diag(query_system::increment_compilation)]
72 #[note(query_system::increment_compilation_note1)]
73 #[note(query_system::increment_compilation_note2)]
74 pub struct IncrementCompilation {
79 #[derive(SessionDiagnostic)]
81 #[diag(query_system::query_overflow)]
82 pub struct QueryOverflow {
84 pub span: Option<Span>,
86 pub layout_of_depth: Option<LayoutOfDepth>,
87 pub suggested_limit: Limit,
88 pub crate_name: Symbol,
91 #[derive(SessionSubdiagnostic)]
92 #[note(query_system::layout_of_depth)]
93 pub struct LayoutOfDepth {