@@ -711,19 +711,23 @@ pub fn build_session_with_codemap(sopts: config::Options,
711711
712712 let emitter: Box < Emitter > = match ( sopts. error_format , emitter_dest) {
713713 ( 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 ) )
716715 }
717716 ( 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 ) )
720718 }
721719 ( config:: ErrorOutputType :: Json , None ) => {
722720 Box :: new ( JsonEmitter :: stderr ( Some ( registry) , codemap. clone ( ) ) )
723721 }
724722 ( config:: ErrorOutputType :: Json , Some ( dst) ) => {
725723 Box :: new ( JsonEmitter :: new ( dst, Some ( registry) , codemap. clone ( ) ) )
726724 }
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+ }
727731 } ;
728732
729733 let diagnostic_handler =
@@ -867,10 +871,12 @@ pub enum IncrCompSession {
867871pub fn early_error ( output : config:: ErrorOutputType , msg : & str ) -> ! {
868872 let emitter: Box < Emitter > = match output {
869873 config:: ErrorOutputType :: HumanReadable ( color_config) => {
870- Box :: new ( EmitterWriter :: stderr ( color_config,
871- None ) )
874+ Box :: new ( EmitterWriter :: stderr ( color_config, None , false ) )
872875 }
873876 config:: ErrorOutputType :: Json => Box :: new ( JsonEmitter :: basic ( ) ) ,
877+ config:: ErrorOutputType :: Short ( color_config) => {
878+ Box :: new ( EmitterWriter :: stderr ( color_config, None , true ) )
879+ }
874880 } ;
875881 let handler = errors:: Handler :: with_emitter ( true , false , emitter) ;
876882 handler. emit ( & MultiSpan :: new ( ) , msg, errors:: Level :: Fatal ) ;
@@ -880,10 +886,12 @@ pub fn early_error(output: config::ErrorOutputType, msg: &str) -> ! {
880886pub fn early_warn ( output : config:: ErrorOutputType , msg : & str ) {
881887 let emitter: Box < Emitter > = match output {
882888 config:: ErrorOutputType :: HumanReadable ( color_config) => {
883- Box :: new ( EmitterWriter :: stderr ( color_config,
884- None ) )
889+ Box :: new ( EmitterWriter :: stderr ( color_config, None , false ) )
885890 }
886891 config:: ErrorOutputType :: Json => Box :: new ( JsonEmitter :: basic ( ) ) ,
892+ config:: ErrorOutputType :: Short ( color_config) => {
893+ Box :: new ( EmitterWriter :: stderr ( color_config, None , true ) )
894+ }
887895 } ;
888896 let handler = errors:: Handler :: with_emitter ( true , false , emitter) ;
889897 handler. emit ( & MultiSpan :: new ( ) , msg, errors:: Level :: Warning ) ;
0 commit comments