@@ -6,7 +6,7 @@ use rustc_data_structures::sync::{IntoDynSyncSend, Lrc};
6
6
use rustc_errors:: emitter:: { DynEmitter , Emitter , HumanEmitter } ;
7
7
use rustc_errors:: translation:: Translate ;
8
8
use rustc_errors:: {
9
- ColorConfig , DiagCtxt , Diagnostic , DiagnosticBuilder , ErrorGuaranteed , Level as DiagnosticLevel ,
9
+ ColorConfig , DiagCtxt , DiagInner , DiagnosticBuilder , ErrorGuaranteed , Level as DiagnosticLevel ,
10
10
} ;
11
11
use rustc_session:: parse:: ParseSess as RawParseSess ;
12
12
use rustc_span:: {
@@ -58,7 +58,7 @@ impl Emitter for SilentEmitter {
58
58
None
59
59
}
60
60
61
- fn emit_diagnostic ( & mut self , _db : Diagnostic ) { }
61
+ fn emit_diagnostic ( & mut self , _diag : DiagInner ) { }
62
62
}
63
63
64
64
fn silent_emitter ( ) -> Box < DynEmitter > {
@@ -75,10 +75,10 @@ struct SilentOnIgnoredFilesEmitter {
75
75
}
76
76
77
77
impl SilentOnIgnoredFilesEmitter {
78
- fn handle_non_ignoreable_error ( & mut self , db : Diagnostic ) {
78
+ fn handle_non_ignoreable_error ( & mut self , diag : DiagInner ) {
79
79
self . has_non_ignorable_parser_errors = true ;
80
80
self . can_reset . store ( false , Ordering :: Release ) ;
81
- self . emitter . emit_diagnostic ( db ) ;
81
+ self . emitter . emit_diagnostic ( diag ) ;
82
82
}
83
83
}
84
84
@@ -97,11 +97,11 @@ impl Emitter for SilentOnIgnoredFilesEmitter {
97
97
None
98
98
}
99
99
100
- fn emit_diagnostic ( & mut self , db : Diagnostic ) {
101
- if db . level ( ) == DiagnosticLevel :: Fatal {
102
- return self . handle_non_ignoreable_error ( db ) ;
100
+ fn emit_diagnostic ( & mut self , diag : DiagInner ) {
101
+ if diag . level ( ) == DiagnosticLevel :: Fatal {
102
+ return self . handle_non_ignoreable_error ( diag ) ;
103
103
}
104
- if let Some ( primary_span) = & db . span . primary_span ( ) {
104
+ if let Some ( primary_span) = & diag . span . primary_span ( ) {
105
105
let file_name = self . source_map . span_to_filename ( * primary_span) ;
106
106
if let rustc_span:: FileName :: Real ( rustc_span:: RealFileName :: LocalPath ( ref path) ) =
107
107
file_name
@@ -117,7 +117,7 @@ impl Emitter for SilentOnIgnoredFilesEmitter {
117
117
}
118
118
} ;
119
119
}
120
- self . handle_non_ignoreable_error ( db ) ;
120
+ self . handle_non_ignoreable_error ( diag ) ;
121
121
}
122
122
}
123
123
@@ -380,13 +380,13 @@ mod tests {
380
380
None
381
381
}
382
382
383
- fn emit_diagnostic ( & mut self , _db : Diagnostic ) {
383
+ fn emit_diagnostic ( & mut self , _diag : DiagInner ) {
384
384
self . num_emitted_errors . fetch_add ( 1 , Ordering :: Release ) ;
385
385
}
386
386
}
387
387
388
- fn build_diagnostic ( level : DiagnosticLevel , span : Option < MultiSpan > ) -> Diagnostic {
389
- let mut diag = Diagnostic :: new ( level, "" ) ;
388
+ fn build_diagnostic ( level : DiagnosticLevel , span : Option < MultiSpan > ) -> DiagInner {
389
+ let mut diag = DiagInner :: new ( level, "" ) ;
390
390
diag. messages . clear ( ) ;
391
391
if let Some ( span) = span {
392
392
diag. span = span;
0 commit comments