@@ -711,19 +711,23 @@ pub fn build_session_with_codemap(sopts: config::Options,
711
711
712
712
let emitter: Box < Emitter > = match ( sopts. error_format , emitter_dest) {
713
713
( config:: ErrorOutputType :: HumanReadable ( color_config) , None ) => {
714
- Box :: new ( EmitterWriter :: stderr ( color_config,
715
- Some ( codemap. clone ( ) ) ) )
714
+ Box :: new ( EmitterWriter :: stderr ( color_config, Some ( codemap. clone ( ) ) , false ) )
716
715
}
717
716
( config:: ErrorOutputType :: HumanReadable ( _) , Some ( dst) ) => {
718
- Box :: new ( EmitterWriter :: new ( dst,
719
- Some ( codemap. clone ( ) ) ) )
717
+ Box :: new ( EmitterWriter :: new ( dst, Some ( codemap. clone ( ) ) , false ) )
720
718
}
721
719
( config:: ErrorOutputType :: Json , None ) => {
722
720
Box :: new ( JsonEmitter :: stderr ( Some ( registry) , codemap. clone ( ) ) )
723
721
}
724
722
( config:: ErrorOutputType :: Json , Some ( dst) ) => {
725
723
Box :: new ( JsonEmitter :: new ( dst, Some ( registry) , codemap. clone ( ) ) )
726
724
}
725
+ ( config:: ErrorOutputType :: Short ( color_config) , None ) => {
726
+ Box :: new ( EmitterWriter :: stderr ( color_config, Some ( codemap. clone ( ) ) , true ) )
727
+ }
728
+ ( config:: ErrorOutputType :: Short ( _) , Some ( dst) ) => {
729
+ Box :: new ( EmitterWriter :: new ( dst, Some ( codemap. clone ( ) ) , true ) )
730
+ }
727
731
} ;
728
732
729
733
let diagnostic_handler =
@@ -867,10 +871,12 @@ pub enum IncrCompSession {
867
871
pub fn early_error ( output : config:: ErrorOutputType , msg : & str ) -> ! {
868
872
let emitter: Box < Emitter > = match output {
869
873
config:: ErrorOutputType :: HumanReadable ( color_config) => {
870
- Box :: new ( EmitterWriter :: stderr ( color_config,
871
- None ) )
874
+ Box :: new ( EmitterWriter :: stderr ( color_config, None , false ) )
872
875
}
873
876
config:: ErrorOutputType :: Json => Box :: new ( JsonEmitter :: basic ( ) ) ,
877
+ config:: ErrorOutputType :: Short ( color_config) => {
878
+ Box :: new ( EmitterWriter :: stderr ( color_config, None , true ) )
879
+ }
874
880
} ;
875
881
let handler = errors:: Handler :: with_emitter ( true , false , emitter) ;
876
882
handler. emit ( & MultiSpan :: new ( ) , msg, errors:: Level :: Fatal ) ;
@@ -880,10 +886,12 @@ pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
880
886
pub fn early_warn ( output : config:: ErrorOutputType , msg : & str ) {
881
887
let emitter: Box < Emitter > = match output {
882
888
config:: ErrorOutputType :: HumanReadable ( color_config) => {
883
- Box :: new ( EmitterWriter :: stderr ( color_config,
884
- None ) )
889
+ Box :: new ( EmitterWriter :: stderr ( color_config, None , false ) )
885
890
}
886
891
config:: ErrorOutputType :: Json => Box :: new ( JsonEmitter :: basic ( ) ) ,
892
+ config:: ErrorOutputType :: Short ( color_config) => {
893
+ Box :: new ( EmitterWriter :: stderr ( color_config, None , true ) )
894
+ }
887
895
} ;
888
896
let handler = errors:: Handler :: with_emitter ( true , false , emitter) ;
889
897
handler. emit ( & MultiSpan :: new ( ) , msg, errors:: Level :: Warning ) ;
0 commit comments