@@ -13,7 +13,7 @@ use crate::Session;
13
13
use rustc_ast:: node_id:: NodeId ;
14
14
use rustc_data_structures:: fx:: { FxHashMap , FxIndexMap , FxIndexSet } ;
15
15
use rustc_data_structures:: sync:: { AppendOnlyVec , Lock , Lrc } ;
16
- use rustc_errors:: emitter:: { HumanEmitter , SilentEmitter } ;
16
+ use rustc_errors:: emitter:: { stderr_destination , HumanEmitter , SilentEmitter } ;
17
17
use rustc_errors:: {
18
18
fallback_fluent_bundle, ColorConfig , Diag , DiagCtxt , DiagnosticMessage , EmissionGuarantee ,
19
19
MultiSpan , StashKey ,
@@ -237,8 +237,10 @@ impl ParseSess {
237
237
pub fn new ( locale_resources : Vec < & ' static str > , file_path_mapping : FilePathMapping ) -> Self {
238
238
let fallback_bundle = fallback_fluent_bundle ( locale_resources, false ) ;
239
239
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
+ ) ;
242
244
let dcx = DiagCtxt :: new ( emitter) ;
243
245
ParseSess :: with_dcx ( dcx, sm)
244
246
}
@@ -268,7 +270,8 @@ impl ParseSess {
268
270
pub fn with_silent_emitter ( fatal_note : String ) -> Self {
269
271
let fallback_bundle = fallback_fluent_bundle ( Vec :: new ( ) , false ) ;
270
272
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) ) ;
272
275
let fatal_dcx = DiagCtxt :: new ( emitter) ;
273
276
let dcx =
274
277
DiagCtxt :: new ( Box :: new ( SilentEmitter { fatal_dcx, fatal_note } ) ) . disable_warnings ( ) ;
0 commit comments