@@ -47,7 +47,7 @@ impl Emitter for SilentEmitter {
47
47
None
48
48
}
49
49
50
- fn emit_diagnostic ( & mut self , _db : & Diagnostic ) { }
50
+ fn emit_diagnostic ( & mut self , _db : Diagnostic ) { }
51
51
}
52
52
53
53
fn silent_emitter ( ) -> Box < DynEmitter > {
@@ -64,7 +64,7 @@ struct SilentOnIgnoredFilesEmitter {
64
64
}
65
65
66
66
impl SilentOnIgnoredFilesEmitter {
67
- fn handle_non_ignoreable_error ( & mut self , db : & Diagnostic ) {
67
+ fn handle_non_ignoreable_error ( & mut self , db : Diagnostic ) {
68
68
self . has_non_ignorable_parser_errors = true ;
69
69
self . can_reset . store ( false , Ordering :: Release ) ;
70
70
self . emitter . emit_diagnostic ( db) ;
@@ -86,7 +86,7 @@ impl Emitter for SilentOnIgnoredFilesEmitter {
86
86
None
87
87
}
88
88
89
- fn emit_diagnostic ( & mut self , db : & Diagnostic ) {
89
+ fn emit_diagnostic ( & mut self , db : Diagnostic ) {
90
90
if db. level ( ) == DiagnosticLevel :: Fatal {
91
91
return self . handle_non_ignoreable_error ( db) ;
92
92
}
@@ -365,7 +365,7 @@ mod tests {
365
365
None
366
366
}
367
367
368
- fn emit_diagnostic ( & mut self , _db : & Diagnostic ) {
368
+ fn emit_diagnostic ( & mut self , _db : Diagnostic ) {
369
369
self . num_emitted_errors . fetch_add ( 1 , Ordering :: Release ) ;
370
370
}
371
371
}
@@ -424,7 +424,7 @@ mod tests {
424
424
) ;
425
425
let span = MultiSpan :: from_span ( mk_sp ( BytePos ( 0 ) , BytePos ( 1 ) ) ) ;
426
426
let fatal_diagnostic = build_diagnostic ( DiagnosticLevel :: Fatal , Some ( span) ) ;
427
- emitter. emit_diagnostic ( & fatal_diagnostic) ;
427
+ emitter. emit_diagnostic ( fatal_diagnostic) ;
428
428
assert_eq ! ( num_emitted_errors. load( Ordering :: Acquire ) , 1 ) ;
429
429
assert_eq ! ( can_reset_errors. load( Ordering :: Acquire ) , false ) ;
430
430
}
@@ -449,7 +449,7 @@ mod tests {
449
449
) ;
450
450
let span = MultiSpan :: from_span ( mk_sp ( BytePos ( 0 ) , BytePos ( 1 ) ) ) ;
451
451
let non_fatal_diagnostic = build_diagnostic ( DiagnosticLevel :: Warning , Some ( span) ) ;
452
- emitter. emit_diagnostic ( & non_fatal_diagnostic) ;
452
+ emitter. emit_diagnostic ( non_fatal_diagnostic) ;
453
453
assert_eq ! ( num_emitted_errors. load( Ordering :: Acquire ) , 0 ) ;
454
454
assert_eq ! ( can_reset_errors. load( Ordering :: Acquire ) , true ) ;
455
455
}
@@ -473,7 +473,7 @@ mod tests {
473
473
) ;
474
474
let span = MultiSpan :: from_span ( mk_sp ( BytePos ( 0 ) , BytePos ( 1 ) ) ) ;
475
475
let non_fatal_diagnostic = build_diagnostic ( DiagnosticLevel :: Warning , Some ( span) ) ;
476
- emitter. emit_diagnostic ( & non_fatal_diagnostic) ;
476
+ emitter. emit_diagnostic ( non_fatal_diagnostic) ;
477
477
assert_eq ! ( num_emitted_errors. load( Ordering :: Acquire ) , 1 ) ;
478
478
assert_eq ! ( can_reset_errors. load( Ordering :: Acquire ) , false ) ;
479
479
}
@@ -512,9 +512,9 @@ mod tests {
512
512
let bar_diagnostic = build_diagnostic ( DiagnosticLevel :: Warning , Some ( bar_span) ) ;
513
513
let foo_diagnostic = build_diagnostic ( DiagnosticLevel :: Warning , Some ( foo_span) ) ;
514
514
let fatal_diagnostic = build_diagnostic ( DiagnosticLevel :: Fatal , None ) ;
515
- emitter. emit_diagnostic ( & bar_diagnostic) ;
516
- emitter. emit_diagnostic ( & foo_diagnostic) ;
517
- emitter. emit_diagnostic ( & fatal_diagnostic) ;
515
+ emitter. emit_diagnostic ( bar_diagnostic) ;
516
+ emitter. emit_diagnostic ( foo_diagnostic) ;
517
+ emitter. emit_diagnostic ( fatal_diagnostic) ;
518
518
assert_eq ! ( num_emitted_errors. load( Ordering :: Acquire ) , 2 ) ;
519
519
assert_eq ! ( can_reset_errors. load( Ordering :: Acquire ) , false ) ;
520
520
}
0 commit comments