@@ -12,7 +12,7 @@ extern crate rustc_session;
12
12
extern crate rustc_span;
13
13
14
14
use rustc_errors:: {
15
- AddSubdiagnostic , IntoDiagnostic , Diagnostic , DiagnosticBuilder ,
15
+ AddToDiagnostic , IntoDiagnostic , Diagnostic , DiagnosticBuilder ,
16
16
ErrorGuaranteed , Handler , fluent
17
17
} ;
18
18
use rustc_macros:: { DiagnosticHandler , SessionSubdiagnostic } ;
@@ -49,29 +49,29 @@ impl<'a> IntoDiagnostic<'a, ErrorGuaranteed> for TranslatableInSessionDiagnostic
49
49
}
50
50
}
51
51
52
- pub struct UntranslatableInAddSubdiagnostic ;
52
+ pub struct UntranslatableInAddToDiagnostic ;
53
53
54
- impl AddSubdiagnostic for UntranslatableInAddSubdiagnostic {
54
+ impl AddToDiagnostic for UntranslatableInAddToDiagnostic {
55
55
fn add_to_diagnostic ( self , diag : & mut Diagnostic ) {
56
56
diag. note ( "untranslatable diagnostic" ) ;
57
57
//~^ ERROR diagnostics should be created using translatable messages
58
58
}
59
59
}
60
60
61
- pub struct TranslatableInAddSubdiagnostic ;
61
+ pub struct TranslatableInAddToDiagnostic ;
62
62
63
- impl AddSubdiagnostic for TranslatableInAddSubdiagnostic {
63
+ impl AddToDiagnostic for TranslatableInAddToDiagnostic {
64
64
fn add_to_diagnostic ( self , diag : & mut Diagnostic ) {
65
65
diag. note ( fluent:: typeck:: note) ;
66
66
}
67
67
}
68
68
69
69
pub fn make_diagnostics < ' a > ( handler : & ' a Handler ) {
70
70
let _diag = handler. struct_err ( fluent:: parser:: expect_path) ;
71
- //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddSubdiagnostic ` impls
71
+ //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic ` impls
72
72
73
73
let _diag = handler. struct_err ( "untranslatable diagnostic" ) ;
74
- //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddSubdiagnostic ` impls
74
+ //~^ ERROR diagnostics should only be created in `IntoDiagnostic`/`AddToDiagnostic ` impls
75
75
//~^^ ERROR diagnostics should be created using translatable messages
76
76
}
77
77
0 commit comments