@@ -13,7 +13,7 @@ use crate::Session;
1313use rustc_ast:: node_id:: NodeId ;
1414use rustc_data_structures:: fx:: { FxHashMap , FxIndexMap , FxIndexSet } ;
1515use rustc_data_structures:: sync:: { AppendOnlyVec , Lock , Lrc } ;
16- use rustc_errors:: emitter:: { HumanEmitter , SilentEmitter } ;
16+ use rustc_errors:: emitter:: { stderr_destination , HumanEmitter , SilentEmitter } ;
1717use rustc_errors:: {
1818 fallback_fluent_bundle, ColorConfig , Diag , DiagCtxt , DiagnosticMessage , EmissionGuarantee ,
1919 MultiSpan , StashKey ,
@@ -237,8 +237,10 @@ impl ParseSess {
237237 pub fn new ( locale_resources : Vec < & ' static str > , file_path_mapping : FilePathMapping ) -> Self {
238238 let fallback_bundle = fallback_fluent_bundle ( locale_resources, false ) ;
239239 let sm = Lrc :: new ( SourceMap :: new ( file_path_mapping) ) ;
240- let emitter =
241- Box :: new ( HumanEmitter :: stderr ( ColorConfig :: Auto , fallback_bundle) . sm ( Some ( sm. clone ( ) ) ) ) ;
240+ let emitter = Box :: new (
241+ HumanEmitter :: new ( stderr_destination ( ColorConfig :: Auto ) , fallback_bundle)
242+ . sm ( Some ( sm. clone ( ) ) ) ,
243+ ) ;
242244 let dcx = DiagCtxt :: new ( emitter) ;
243245 ParseSess :: with_dcx ( dcx, sm)
244246 }
@@ -268,7 +270,8 @@ impl ParseSess {
268270 pub fn with_silent_emitter ( fatal_note : String ) -> Self {
269271 let fallback_bundle = fallback_fluent_bundle ( Vec :: new ( ) , false ) ;
270272 let sm = Lrc :: new ( SourceMap :: new ( FilePathMapping :: empty ( ) ) ) ;
271- let emitter = Box :: new ( HumanEmitter :: stderr ( ColorConfig :: Auto , fallback_bundle) ) ;
273+ let emitter =
274+ Box :: new ( HumanEmitter :: new ( stderr_destination ( ColorConfig :: Auto ) , fallback_bundle) ) ;
272275 let fatal_dcx = DiagCtxt :: new ( emitter) ;
273276 let dcx =
274277 DiagCtxt :: new ( Box :: new ( SilentEmitter { fatal_dcx, fatal_note } ) ) . disable_warnings ( ) ;
0 commit comments