@@ -31,7 +31,6 @@ use crate::emitter::{
3131 ColorConfig , Destination , Emitter , HumanReadableErrorType , OutputTheme , TimingEvent ,
3232 should_show_source_code,
3333} ;
34- use crate :: registry:: Registry ;
3534use crate :: timings:: { TimingRecord , TimingSection } ;
3635use crate :: translation:: { Translator , to_fluent_args} ;
3736use crate :: { CodeSuggestion , MultiSpan , SpanLabel , Subdiag , Suggestions , TerminalUrl } ;
@@ -107,8 +106,8 @@ enum EmitTyped<'a> {
107106}
108107
109108impl Emitter for JsonEmitter {
110- fn emit_diagnostic ( & mut self , diag : crate :: DiagInner , registry : & Registry ) {
111- let data = Diagnostic :: from_errors_diagnostic ( diag, self , registry ) ;
109+ fn emit_diagnostic ( & mut self , diag : crate :: DiagInner ) {
110+ let data = Diagnostic :: from_errors_diagnostic ( diag, self ) ;
112111 let result = self . emit ( EmitTyped :: Diagnostic ( data) ) ;
113112 if let Err ( e) = result {
114113 panic ! ( "failed to print diagnostics: {e:?}" ) ;
@@ -139,7 +138,7 @@ impl Emitter for JsonEmitter {
139138 }
140139 }
141140
142- fn emit_future_breakage_report ( & mut self , diags : Vec < crate :: DiagInner > , registry : & Registry ) {
141+ fn emit_future_breakage_report ( & mut self , diags : Vec < crate :: DiagInner > ) {
143142 let data: Vec < FutureBreakageItem < ' _ > > = diags
144143 . into_iter ( )
145144 . map ( |mut diag| {
@@ -153,7 +152,7 @@ impl Emitter for JsonEmitter {
153152 }
154153 FutureBreakageItem {
155154 diagnostic : EmitTyped :: Diagnostic ( Diagnostic :: from_errors_diagnostic (
156- diag, self , registry ,
155+ diag, self ,
157156 ) ) ,
158157 }
159158 } )
@@ -307,11 +306,7 @@ struct UnusedExterns<'a> {
307306
308307impl Diagnostic {
309308 /// Converts from `rustc_errors::DiagInner` to `Diagnostic`.
310- fn from_errors_diagnostic (
311- diag : crate :: DiagInner ,
312- je : & JsonEmitter ,
313- registry : & Registry ,
314- ) -> Diagnostic {
309+ fn from_errors_diagnostic ( diag : crate :: DiagInner , je : & JsonEmitter ) -> Diagnostic {
315310 let args = to_fluent_args ( diag. args . iter ( ) ) ;
316311 let sugg_to_diag = |sugg : & CodeSuggestion | {
317312 let translated_message =
@@ -351,7 +346,7 @@ impl Diagnostic {
351346 let code = if let Some ( code) = diag. code {
352347 Some ( DiagnosticCode {
353348 code : code. to_string ( ) ,
354- explanation : registry . try_find_description ( code) . ok ( ) ,
349+ explanation : crate :: codes :: try_find_description ( code) . ok ( ) ,
355350 } )
356351 } else if let Some ( IsLint { name, .. } ) = & diag. is_lint {
357352 Some ( DiagnosticCode { code : name. to_string ( ) , explanation : None } )
@@ -388,7 +383,7 @@ impl Diagnostic {
388383 . ui_testing ( je. ui_testing )
389384 . ignored_directories_in_source_blocks ( je. ignored_directories_in_source_blocks . clone ( ) )
390385 . theme ( if je. json_rendered . unicode { OutputTheme :: Unicode } else { OutputTheme :: Ascii } )
391- . emit_diagnostic ( diag, registry ) ;
386+ . emit_diagnostic ( diag) ;
392387
393388 let buf = Arc :: try_unwrap ( buf. 0 ) . unwrap ( ) . into_inner ( ) . unwrap ( ) ;
394389 let buf = String :: from_utf8 ( buf) . unwrap ( ) ;
0 commit comments