@@ -715,19 +715,23 @@ pub fn build_session_with_codemap(sopts: config::Options,
715
715
716
716
let emitter: Box < Emitter > = match ( sopts. error_format , emitter_dest) {
717
717
( config:: ErrorOutputType :: HumanReadable ( color_config) , None ) => {
718
- Box :: new ( EmitterWriter :: stderr ( color_config,
719
- Some ( codemap. clone ( ) ) ) )
718
+ Box :: new ( EmitterWriter :: stderr ( color_config, Some ( codemap. clone ( ) ) , false ) )
720
719
}
721
720
( config:: ErrorOutputType :: HumanReadable ( _) , Some ( dst) ) => {
722
- Box :: new ( EmitterWriter :: new ( dst,
723
- Some ( codemap. clone ( ) ) ) )
721
+ Box :: new ( EmitterWriter :: new ( dst, Some ( codemap. clone ( ) ) , false ) )
724
722
}
725
723
( config:: ErrorOutputType :: Json , None ) => {
726
724
Box :: new ( JsonEmitter :: stderr ( Some ( registry) , codemap. clone ( ) ) )
727
725
}
728
726
( config:: ErrorOutputType :: Json , Some ( dst) ) => {
729
727
Box :: new ( JsonEmitter :: new ( dst, Some ( registry) , codemap. clone ( ) ) )
730
728
}
729
+ ( config:: ErrorOutputType :: Short ( color_config) , None ) => {
730
+ Box :: new ( EmitterWriter :: stderr ( color_config, Some ( codemap. clone ( ) ) , true ) )
731
+ }
732
+ ( config:: ErrorOutputType :: Short ( _) , Some ( dst) ) => {
733
+ Box :: new ( EmitterWriter :: new ( dst, Some ( codemap. clone ( ) ) , true ) )
734
+ }
731
735
} ;
732
736
733
737
let diagnostic_handler =
@@ -891,10 +895,12 @@ pub enum IncrCompSession {
891
895
pub fn early_error ( output : config:: ErrorOutputType , msg : & str ) -> ! {
892
896
let emitter: Box < Emitter > = match output {
893
897
config:: ErrorOutputType :: HumanReadable ( color_config) => {
894
- Box :: new ( EmitterWriter :: stderr ( color_config,
895
- None ) )
898
+ Box :: new ( EmitterWriter :: stderr ( color_config, None , false ) )
896
899
}
897
900
config:: ErrorOutputType :: Json => Box :: new ( JsonEmitter :: basic ( ) ) ,
901
+ config:: ErrorOutputType :: Short ( color_config) => {
902
+ Box :: new ( EmitterWriter :: stderr ( color_config, None , true ) )
903
+ }
898
904
} ;
899
905
let handler = errors:: Handler :: with_emitter ( true , false , emitter) ;
900
906
handler. emit ( & MultiSpan :: new ( ) , msg, errors:: Level :: Fatal ) ;
@@ -904,10 +910,12 @@ pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
904
910
pub fn early_warn ( output : config:: ErrorOutputType , msg : & str ) {
905
911
let emitter: Box < Emitter > = match output {
906
912
config:: ErrorOutputType :: HumanReadable ( color_config) => {
907
- Box :: new ( EmitterWriter :: stderr ( color_config,
908
- None ) )
913
+ Box :: new ( EmitterWriter :: stderr ( color_config, None , false ) )
909
914
}
910
915
config:: ErrorOutputType :: Json => Box :: new ( JsonEmitter :: basic ( ) ) ,
916
+ config:: ErrorOutputType :: Short ( color_config) => {
917
+ Box :: new ( EmitterWriter :: stderr ( color_config, None , true ) )
918
+ }
911
919
} ;
912
920
let handler = errors:: Handler :: with_emitter ( true , false , emitter) ;
913
921
handler. emit ( & MultiSpan :: new ( ) , msg, errors:: Level :: Warning ) ;
0 commit comments