@@ -3,7 +3,7 @@ use std::sync::Arc;
33use std:: sync:: atomic:: { AtomicBool , Ordering } ;
44
55use 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} ;
77use rustc_errors:: registry:: Registry ;
88use rustc_errors:: translation:: Translator ;
99use rustc_errors:: { ColorConfig , Diag , DiagCtxt , DiagInner , Level as DiagnosticLevel } ;
@@ -105,19 +105,14 @@ fn default_dcx(
105105 } ;
106106
107107 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+ )
119114 } else {
120- emitter
115+ Box :: new ( SilentEmitter { translator } )
121116 } ;
122117 DiagCtxt :: new ( Box :: new ( SilentOnIgnoredFilesEmitter {
123118 has_non_ignorable_parser_errors : false ,
@@ -196,7 +191,7 @@ impl ParseSess {
196191 }
197192
198193 pub ( crate ) fn set_silent_emitter ( & mut self ) {
199- self . raw_psess . dcx ( ) . make_silent ( None , false ) ;
194+ self . raw_psess . dcx ( ) . make_silent ( ) ;
200195 }
201196
202197 pub ( crate ) fn span_to_filename ( & self , span : Span ) -> FileName {
0 commit comments