@@ -3,7 +3,7 @@ use std::sync::Arc;
3
3
use std:: sync:: atomic:: { AtomicBool , Ordering } ;
4
4
5
5
use rustc_data_structures:: sync:: IntoDynSyncSend ;
6
- use rustc_errors:: emitter:: { DynEmitter , Emitter , HumanEmitter , FatalOnlyEmitter , stderr_destination} ;
6
+ use rustc_errors:: emitter:: { DynEmitter , Emitter , HumanEmitter , SilentEmitter , stderr_destination} ;
7
7
use rustc_errors:: registry:: Registry ;
8
8
use rustc_errors:: translation:: Translator ;
9
9
use rustc_errors:: { ColorConfig , Diag , DiagCtxt , DiagInner , Level as DiagnosticLevel } ;
@@ -105,19 +105,14 @@ fn default_dcx(
105
105
} ;
106
106
107
107
let translator = rustc_driver:: default_translator ( ) ;
108
- let emitter = Box :: new (
109
- HumanEmitter :: new ( stderr_destination ( emit_color) , translator)
110
- . sm ( Some ( source_map. clone ( ) ) ) ,
111
- ) ;
112
-
113
- let emitter: Box < DynEmitter > = if !show_parse_errors {
114
- Box :: new ( FatalOnlyEmitter {
115
- fatal_emitter : emitter,
116
- fatal_note : None ,
117
- emit_fatal_diagnostic : false ,
118
- } )
108
+
109
+ let emitter: Box < DynEmitter > = if show_parse_errors {
110
+ Box :: new (
111
+ HumanEmitter :: new ( stderr_destination ( emit_color) , translator)
112
+ . sm ( Some ( source_map. clone ( ) ) ) ,
113
+ )
119
114
} else {
120
- emitter
115
+ Box :: new ( SilentEmitter { translator } )
121
116
} ;
122
117
DiagCtxt :: new ( Box :: new ( SilentOnIgnoredFilesEmitter {
123
118
has_non_ignorable_parser_errors : false ,
@@ -196,7 +191,7 @@ impl ParseSess {
196
191
}
197
192
198
193
pub ( crate ) fn set_silent_emitter ( & mut self ) {
199
- self . raw_psess . dcx ( ) . make_silent ( None , false ) ;
194
+ self . raw_psess . dcx ( ) . make_silent ( ) ;
200
195
}
201
196
202
197
pub ( crate ) fn span_to_filename ( & self , span : Span ) -> FileName {
0 commit comments