@@ -4,7 +4,7 @@ use std::sync::atomic::{AtomicBool, Ordering};
44use rustc_data_structures:: sync:: { IntoDynSyncSend , Lrc } ;
55use rustc_errors:: emitter:: { DynEmitter , Emitter , EmitterWriter } ;
66use rustc_errors:: translation:: Translate ;
7- use rustc_errors:: { ColorConfig , Diagnostic , Handler , Level as DiagnosticLevel } ;
7+ use rustc_errors:: { ColorConfig , DiagCtxt , Diagnostic , Level as DiagnosticLevel } ;
88use rustc_session:: parse:: ParseSess as RawParseSess ;
99use rustc_span:: {
1010 source_map:: { FilePathMapping , SourceMap } ,
@@ -124,7 +124,7 @@ fn default_handler(
124124 can_reset : Lrc < AtomicBool > ,
125125 hide_parse_errors : bool ,
126126 color : Color ,
127- ) -> Handler {
127+ ) -> DiagCtxt {
128128 let supports_color = term:: stderr ( ) . map_or ( false , |term| term. supports_color ( ) ) ;
129129 let emit_color = if supports_color {
130130 ColorConfig :: from ( color)
@@ -141,7 +141,7 @@ fn default_handler(
141141 ) ;
142142 Box :: new ( EmitterWriter :: stderr ( emit_color, fallback_bundle) . sm ( Some ( source_map. clone ( ) ) ) )
143143 } ;
144- Handler :: with_emitter ( Box :: new ( SilentOnIgnoredFilesEmitter {
144+ DiagCtxt :: with_emitter ( Box :: new ( SilentOnIgnoredFilesEmitter {
145145 has_non_ignorable_parser_errors : false ,
146146 source_map,
147147 emitter,
@@ -218,7 +218,7 @@ impl ParseSess {
218218 }
219219
220220 pub ( crate ) fn set_silent_emitter ( & mut self ) {
221- self . parse_sess . span_diagnostic = Handler :: with_emitter ( silent_emitter ( ) ) ;
221+ self . parse_sess . span_diagnostic = DiagCtxt :: with_emitter ( silent_emitter ( ) ) ;
222222 }
223223
224224 pub ( crate ) fn span_to_filename ( & self , span : Span ) -> FileName {
0 commit comments