File tree Expand file tree Collapse file tree 3 files changed +7
-12
lines changed
rustc_error_messages/locales/en-US Expand file tree Collapse file tree 3 files changed +7
-12
lines changed Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ query_system_cycle_usage = cycle used when {$usage}
1212
1313query_system_cycle_stack_single = ...which immediately requires { $stack_bottom } again
1414
15+ query_system_cycle_stack_middle = ...which requires { $desc } ...
16+
1517query_system_cycle_stack_multiple = ...which again requires { $stack_bottom } , completing the cycle
1618
1719query_system_cycle_recursive_ty_alias = type aliases cannot be recursive
Original file line number Diff line number Diff line change 1- use rustc_errors:: { AddToDiagnostic , Diagnostic , SubdiagnosticMessage } ;
21use rustc_macros:: { Diagnostic , Subdiagnostic } ;
32use rustc_session:: Limit ;
43use rustc_span:: { Span , Symbol } ;
54
5+ #[ derive( Subdiagnostic ) ]
6+ #[ note( query_system:: cycle_stack_middle) ]
67pub struct CycleStack {
8+ #[ primary_span]
79 pub span : Span ,
810 pub desc : String ,
911}
1012
11- impl AddToDiagnostic for CycleStack {
12- fn add_to_diagnostic_with < F > ( self , diag : & mut Diagnostic , _: F )
13- where
14- F : Fn ( & mut Diagnostic , SubdiagnosticMessage ) -> SubdiagnosticMessage ,
15- {
16- diag. span_note ( self . span , & format ! ( "...which requires {}..." , self . desc) ) ;
17- }
18- }
19-
2013#[ derive( Copy , Clone ) ]
2114pub enum HandleCycleError {
2215 Error ,
@@ -56,7 +49,7 @@ pub struct Cycle {
5649 #[ primary_span]
5750 pub span : Span ,
5851 pub stack_bottom : String ,
59- #[ subdiagnostic]
52+ #[ subdiagnostic( eager ) ]
6053 pub cycle_stack : Vec < CycleStack > ,
6154 #[ subdiagnostic]
6255 pub stack_count : StackCount ,
Original file line number Diff line number Diff line change 44#![ feature( min_specialization) ]
55#![ feature( extern_types) ]
66#![ allow( rustc:: potential_query_instability) ]
7- // #![deny(rustc::untranslatable_diagnostic)]
7+ #![ deny( rustc:: untranslatable_diagnostic) ]
88#![ deny( rustc:: diagnostic_outside_of_impl) ]
99
1010#[ macro_use]
You can’t perform that action at this time.
0 commit comments