@@ -62,30 +62,11 @@ impl HumanReadableErrorType {
6262 pub fn new_emitter (
6363 self ,
6464 dst : Box < dyn Write + Send > ,
65- source_map : Option < Lrc < SourceMap > > ,
66- bundle : Option < Lrc < FluentBundle > > ,
6765 fallback_bundle : LazyFallbackBundle ,
68- teach : bool ,
69- diagnostic_width : Option < usize > ,
70- macro_backtrace : bool ,
71- track_diagnostics : bool ,
72- terminal_url : TerminalUrl ,
7366 ) -> EmitterWriter {
7467 let ( short, color_config) = self . unzip ( ) ;
7568 let color = color_config. suggests_using_colors ( ) ;
76- EmitterWriter :: new (
77- dst,
78- source_map,
79- bundle,
80- fallback_bundle,
81- short,
82- teach,
83- color,
84- diagnostic_width,
85- macro_backtrace,
86- track_diagnostics,
87- terminal_url,
88- )
69+ EmitterWriter :: new ( dst, fallback_bundle, color) . short_message ( short)
8970 }
9071}
9172
@@ -668,6 +649,10 @@ pub struct FileWithAnnotatedLines {
668649impl EmitterWriter {
669650 pub fn stderr ( color_config : ColorConfig , fallback_bundle : LazyFallbackBundle ) -> EmitterWriter {
670651 let dst = Destination :: from_stderr ( color_config) ;
652+ Self :: create ( dst, fallback_bundle)
653+ }
654+
655+ fn create ( dst : Destination , fallback_bundle : LazyFallbackBundle ) -> EmitterWriter {
671656 EmitterWriter {
672657 dst,
673658 sm : None ,
@@ -685,30 +670,10 @@ impl EmitterWriter {
685670
686671 pub fn new (
687672 dst : Box < dyn Write + Send > ,
688- source_map : Option < Lrc < SourceMap > > ,
689- fluent_bundle : Option < Lrc < FluentBundle > > ,
690673 fallback_bundle : LazyFallbackBundle ,
691- short_message : bool ,
692- teach : bool ,
693674 colored : bool ,
694- diagnostic_width : Option < usize > ,
695- macro_backtrace : bool ,
696- track_diagnostics : bool ,
697- terminal_url : TerminalUrl ,
698675 ) -> EmitterWriter {
699- EmitterWriter {
700- dst : Raw ( dst, colored) ,
701- sm : source_map,
702- fluent_bundle,
703- fallback_bundle,
704- short_message,
705- teach,
706- ui_testing : false ,
707- diagnostic_width,
708- macro_backtrace,
709- track_diagnostics,
710- terminal_url,
711- }
676+ Self :: create ( Raw ( dst, colored) , fallback_bundle)
712677 }
713678
714679 fn maybe_anonymized ( & self , line_num : usize ) -> Cow < ' static , str > {
0 commit comments