@@ -180,7 +180,7 @@ const ANONYMIZED_LINE_NUM: &str = "LL";
180
180
/// Emitter trait for emitting errors.
181
181
pub trait Emitter {
182
182
/// Emit a structured diagnostic.
183
- fn emit_diagnostic ( & mut self , db : & Diagnostic ) ;
183
+ fn emit_diagnostic ( & mut self , diag : & Diagnostic ) ;
184
184
185
185
/// Emit a notification that an artifact has been output.
186
186
/// This is currently only supported for the JSON format,
@@ -206,10 +206,10 @@ pub trait Emitter {
206
206
/// we return the original `primary_span` and the original suggestions.
207
207
fn primary_span_formatted < ' a > (
208
208
& mut self ,
209
- db : & ' a Diagnostic ,
209
+ diag : & ' a Diagnostic ,
210
210
) -> ( 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 ( ) {
213
213
if rest. is_empty ( ) &&
214
214
// ^ if there is only one suggestion
215
215
// don't display multi-suggestions as labels
@@ -260,10 +260,10 @@ pub trait Emitter {
260
260
// to be consistent. We could try to figure out if we can
261
261
// make one (or the first one) inline, but that would give
262
262
// undue importance to a semi-random suggestion
263
- ( primary_span, & db . suggestions )
263
+ ( primary_span, & diag . suggestions )
264
264
}
265
265
} else {
266
- ( primary_span, & db . suggestions )
266
+ ( primary_span, & diag . suggestions )
267
267
}
268
268
}
269
269
@@ -401,19 +401,19 @@ impl Emitter for EmitterWriter {
401
401
self . sm . as_ref ( )
402
402
}
403
403
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 ) ;
407
407
408
408
self . fix_multispans_in_std_macros ( & self . sm ,
409
409
& mut primary_span,
410
410
& mut children,
411
- & db . level ,
411
+ & diag . level ,
412
412
self . external_macro_backtrace ) ;
413
413
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 ,
417
417
& primary_span,
418
418
& children,
419
419
& suggestions) ;
0 commit comments