@@ -715,19 +715,23 @@ pub fn build_session_with_codemap(sopts: config::Options,
715715
716716 let emitter: Box < Emitter > = match ( sopts. error_format , emitter_dest) {
717717 ( 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 ) )
720719 }
721720 ( 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 ) )
724722 }
725723 ( config:: ErrorOutputType :: Json , None ) => {
726724 Box :: new ( JsonEmitter :: stderr ( Some ( registry) , codemap. clone ( ) ) )
727725 }
728726 ( config:: ErrorOutputType :: Json , Some ( dst) ) => {
729727 Box :: new ( JsonEmitter :: new ( dst, Some ( registry) , codemap. clone ( ) ) )
730728 }
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+ }
731735 } ;
732736
733737 let diagnostic_handler =
@@ -891,10 +895,12 @@ pub enum IncrCompSession {
891895pub fn early_error ( output : config:: ErrorOutputType , msg : & str ) -> ! {
892896 let emitter: Box < Emitter > = match output {
893897 config:: ErrorOutputType :: HumanReadable ( color_config) => {
894- Box :: new ( EmitterWriter :: stderr ( color_config,
895- None ) )
898+ Box :: new ( EmitterWriter :: stderr ( color_config, None , false ) )
896899 }
897900 config:: ErrorOutputType :: Json => Box :: new ( JsonEmitter :: basic ( ) ) ,
901+ config:: ErrorOutputType :: Short ( color_config) => {
902+ Box :: new ( EmitterWriter :: stderr ( color_config, None , true ) )
903+ }
898904 } ;
899905 let handler = errors:: Handler :: with_emitter ( true , false , emitter) ;
900906 handler. emit ( & MultiSpan :: new ( ) , msg, errors:: Level :: Fatal ) ;
@@ -904,10 +910,12 @@ pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
904910pub fn early_warn ( output : config:: ErrorOutputType , msg : & str ) {
905911 let emitter: Box < Emitter > = match output {
906912 config:: ErrorOutputType :: HumanReadable ( color_config) => {
907- Box :: new ( EmitterWriter :: stderr ( color_config,
908- None ) )
913+ Box :: new ( EmitterWriter :: stderr ( color_config, None , false ) )
909914 }
910915 config:: ErrorOutputType :: Json => Box :: new ( JsonEmitter :: basic ( ) ) ,
916+ config:: ErrorOutputType :: Short ( color_config) => {
917+ Box :: new ( EmitterWriter :: stderr ( color_config, None , true ) )
918+ }
911919 } ;
912920 let handler = errors:: Handler :: with_emitter ( true , false , emitter) ;
913921 handler. emit ( & MultiSpan :: new ( ) , msg, errors:: Level :: Warning ) ;
0 commit comments