1 use rustc_macros::{Diagnostic, Subdiagnostic};
2 use rustc_session::Limit;
3 use rustc_span::{Span, Symbol};
5 #[derive(Subdiagnostic)]
6 #[note(query_system_cycle_stack_middle)]
7 pub struct CycleStack {
13 #[derive(Copy, Clone)]
14 pub enum HandleCycleError {
20 #[derive(Subdiagnostic)]
22 #[note(query_system_cycle_stack_single)]
24 #[note(query_system_cycle_stack_multiple)]
28 #[derive(Subdiagnostic)]
30 #[note(query_system_cycle_recursive_ty_alias)]
31 #[help(query_system_cycle_recursive_ty_alias_help1)]
32 #[help(query_system_cycle_recursive_ty_alias_help2)]
34 #[note(query_system_cycle_recursive_trait_alias)]
38 #[derive(Subdiagnostic)]
39 #[note(query_system_cycle_usage)]
40 pub struct CycleUsage {
47 #[diag(query_system_cycle, code = "E0391")]
51 pub stack_bottom: String,
53 pub cycle_stack: Vec<CycleStack>,
55 pub stack_count: StackCount,
57 pub alias: Option<Alias>,
59 pub cycle_usage: Option<CycleUsage>,
63 #[diag(query_system_reentrant)]
67 #[diag(query_system_increment_compilation)]
69 #[note(query_system_increment_compilation_note1)]
70 #[note(query_system_increment_compilation_note2)]
71 pub struct IncrementCompilation {
78 #[diag(query_system_query_overflow)]
79 pub struct QueryOverflow {
81 pub span: Option<Span>,
83 pub layout_of_depth: Option<LayoutOfDepth>,
84 pub suggested_limit: Limit,
85 pub crate_name: Symbol,
88 #[derive(Subdiagnostic)]
89 #[note(query_system_layout_of_depth)]
90 pub struct LayoutOfDepth {