File tree 3 files changed +7
-12
lines changed
rustc_error_messages/locales/en-US
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}
12
12
13
13
query_system_cycle_stack_single = ...which immediately requires { $stack_bottom } again
14
14
15
+ query_system_cycle_stack_middle = ...which requires { $desc } ...
16
+
15
17
query_system_cycle_stack_multiple = ...which again requires { $stack_bottom } , completing the cycle
16
18
17
19
query_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 } ;
2
1
use rustc_macros:: { Diagnostic , Subdiagnostic } ;
3
2
use rustc_session:: Limit ;
4
3
use rustc_span:: { Span , Symbol } ;
5
4
5
+ #[ derive( Subdiagnostic ) ]
6
+ #[ note( query_system:: cycle_stack_middle) ]
6
7
pub struct CycleStack {
8
+ #[ primary_span]
7
9
pub span : Span ,
8
10
pub desc : String ,
9
11
}
10
12
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
-
20
13
#[ derive( Copy , Clone ) ]
21
14
pub enum HandleCycleError {
22
15
Error ,
@@ -56,7 +49,7 @@ pub struct Cycle {
56
49
#[ primary_span]
57
50
pub span : Span ,
58
51
pub stack_bottom : String ,
59
- #[ subdiagnostic]
52
+ #[ subdiagnostic( eager ) ]
60
53
pub cycle_stack : Vec < CycleStack > ,
61
54
#[ subdiagnostic]
62
55
pub stack_count : StackCount ,
Original file line number Diff line number Diff line change 4
4
#![ feature( min_specialization) ]
5
5
#![ feature( extern_types) ]
6
6
#![ allow( rustc:: potential_query_instability) ]
7
- // #![deny(rustc::untranslatable_diagnostic)]
7
+ #![ deny( rustc:: untranslatable_diagnostic) ]
8
8
#![ deny( rustc:: diagnostic_outside_of_impl) ]
9
9
10
10
#[ macro_use]
You can’t perform that action at this time.
0 commit comments