@@ -180,7 +180,7 @@ const ANONYMIZED_LINE_NUM: &str = "LL";
180180/// Emitter trait for emitting errors.
181181pub trait Emitter {
182182 /// Emit a structured diagnostic.
183- fn emit_diagnostic ( & mut self , db : & Diagnostic ) ;
183+ fn emit_diagnostic ( & mut self , diag : & Diagnostic ) ;
184184
185185 /// Emit a notification that an artifact has been output.
186186 /// This is currently only supported for the JSON format,
@@ -206,10 +206,10 @@ pub trait Emitter {
206206 /// we return the original `primary_span` and the original suggestions.
207207 fn primary_span_formatted < ' a > (
208208 & mut self ,
209- db : & ' a Diagnostic ,
209+ diag : & ' a Diagnostic ,
210210 ) -> ( MultiSpan , & ' a [ CodeSuggestion ] ) {
211- let mut primary_span = db . span . clone ( ) ;
212- if let Some ( ( sugg, rest) ) = db . suggestions . split_first ( ) {
211+ let mut primary_span = diag . span . clone ( ) ;
212+ if let Some ( ( sugg, rest) ) = diag . suggestions . split_first ( ) {
213213 if rest. is_empty ( ) &&
214214 // ^ if there is only one suggestion
215215 // don't display multi-suggestions as labels
@@ -260,10 +260,10 @@ pub trait Emitter {
260260 // to be consistent. We could try to figure out if we can
261261 // make one (or the first one) inline, but that would give
262262 // undue importance to a semi-random suggestion
263- ( primary_span, & db . suggestions )
263+ ( primary_span, & diag . suggestions )
264264 }
265265 } else {
266- ( primary_span, & db . suggestions )
266+ ( primary_span, & diag . suggestions )
267267 }
268268 }
269269
@@ -401,19 +401,19 @@ impl Emitter for EmitterWriter {
401401 self . sm . as_ref ( )
402402 }
403403
404- fn emit_diagnostic ( & mut self , db : & Diagnostic ) {
405- let mut children = db . children . clone ( ) ;
406- let ( mut primary_span, suggestions) = self . primary_span_formatted ( & db ) ;
404+ fn emit_diagnostic ( & mut self , diag : & Diagnostic ) {
405+ let mut children = diag . children . clone ( ) ;
406+ let ( mut primary_span, suggestions) = self . primary_span_formatted ( & diag ) ;
407407
408408 self . fix_multispans_in_std_macros ( & self . sm ,
409409 & mut primary_span,
410410 & mut children,
411- & db . level ,
411+ & diag . level ,
412412 self . external_macro_backtrace ) ;
413413
414- self . emit_messages_default ( & db . level ,
415- & db . styled_message ( ) ,
416- & db . code ,
414+ self . emit_messages_default ( & diag . level ,
415+ & diag . styled_message ( ) ,
416+ & diag . code ,
417417 & primary_span,
418418 & children,
419419 & suggestions) ;
0 commit comments