File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change @@ -29,7 +29,7 @@ use term;
29
29
/// implement `CoreEmitter` instead.
30
30
pub trait Emitter {
31
31
/// Emit a structured diagnostic.
32
- fn emit_struct ( & mut self , db : & DiagnosticBuilder ) ;
32
+ fn emit ( & mut self , db : & DiagnosticBuilder ) ;
33
33
}
34
34
35
35
pub trait CoreEmitter {
@@ -43,7 +43,7 @@ pub trait CoreEmitter {
43
43
}
44
44
45
45
impl < T : CoreEmitter > Emitter for T {
46
- fn emit_struct ( & mut self , db : & DiagnosticBuilder ) {
46
+ fn emit ( & mut self , db : & DiagnosticBuilder ) {
47
47
let old_school = check_old_skool ( ) ;
48
48
let db_span = FullSpan ( db. span . clone ( ) ) ;
49
49
self . emit_message ( & FullSpan ( db. span . clone ( ) ) ,
Original file line number Diff line number Diff line change @@ -238,7 +238,7 @@ impl<'a> DiagnosticBuilder<'a> {
238
238
return ;
239
239
}
240
240
241
- self . handler . emit . borrow_mut ( ) . emit_struct ( & self ) ;
241
+ self . handler . emitter . borrow_mut ( ) . emit ( & self ) ;
242
242
self . cancel ( ) ;
243
243
self . handler . panic_if_treat_err_as_bug ( ) ;
244
244
@@ -420,7 +420,7 @@ impl<'a> Drop for DiagnosticBuilder<'a> {
420
420
/// others log errors for later reporting.
421
421
pub struct Handler {
422
422
err_count : Cell < usize > ,
423
- emit : RefCell < Box < Emitter > > ,
423
+ emitter : RefCell < Box < Emitter > > ,
424
424
pub can_emit_warnings : bool ,
425
425
treat_err_as_bug : bool ,
426
426
continue_after_error : Cell < bool > ,
@@ -444,7 +444,7 @@ impl Handler {
444
444
e : Box < Emitter > ) -> Handler {
445
445
Handler {
446
446
err_count : Cell :: new ( 0 ) ,
447
- emit : RefCell :: new ( e) ,
447
+ emitter : RefCell :: new ( e) ,
448
448
can_emit_warnings : can_emit_warnings,
449
449
treat_err_as_bug : treat_err_as_bug,
450
450
continue_after_error : Cell :: new ( true ) ,
Original file line number Diff line number Diff line change @@ -53,7 +53,7 @@ impl JsonEmitter {
53
53
}
54
54
55
55
impl Emitter for JsonEmitter {
56
- fn emit_struct ( & mut self , db : & DiagnosticBuilder ) {
56
+ fn emit ( & mut self , db : & DiagnosticBuilder ) {
57
57
let data = Diagnostic :: from_diagnostic_builder ( db, self ) ;
58
58
if let Err ( e) = writeln ! ( & mut self . dst, "{}" , as_json( & data) ) {
59
59
panic ! ( "failed to print diagnostics: {:?}" , e) ;
You can’t perform that action at this time.
0 commit comments