@@ -837,7 +837,7 @@ pub enum ErrorOutputType {
837837 /// Output meant for the consumption of humans.
838838 #[ default]
839839 HumanReadable {
840- kind : HumanReadableErrorType = HumanReadableErrorType :: Default ,
840+ kind : HumanReadableErrorType = HumanReadableErrorType :: Default { short : false } ,
841841 color_config: ColorConfig = ColorConfig :: Auto ,
842842 } ,
843843 /// Output that's consumed by other tools such as `rustfix` or the `RLS`.
@@ -2053,7 +2053,7 @@ impl JsonUnusedExterns {
20532053/// The first value returned is how to render JSON diagnostics, and the second
20542054/// is whether or not artifact notifications are enabled.
20552055pub fn parse_json ( early_dcx : & EarlyDiagCtxt , matches : & getopts:: Matches ) -> JsonConfig {
2056- let mut json_rendered = HumanReadableErrorType :: Default ;
2056+ let mut json_rendered = HumanReadableErrorType :: Default { short : false } ;
20572057 let mut json_color = ColorConfig :: Never ;
20582058 let mut json_artifact_notifications = false ;
20592059 let mut json_unused_externs = JsonUnusedExterns :: No ;
@@ -2069,9 +2069,12 @@ pub fn parse_json(early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches) -> Json
20692069
20702070 for sub_option in option. split ( ',' ) {
20712071 match sub_option {
2072- "diagnostic-short" => json_rendered = HumanReadableErrorType :: Short ,
2072+ "diagnostic-short" => {
2073+ json_rendered = HumanReadableErrorType :: Default { short : true }
2074+ }
20732075 "diagnostic-unicode" => {
2074- json_rendered = HumanReadableErrorType :: AnnotateSnippet { unicode : true } ;
2076+ json_rendered =
2077+ HumanReadableErrorType :: AnnotateSnippet { short : false , unicode : true } ;
20752078 }
20762079 "diagnostic-rendered-ansi" => json_color = ColorConfig :: Always ,
20772080 "artifacts" => json_artifact_notifications = true ,
@@ -2110,7 +2113,7 @@ pub fn parse_error_format(
21102113 match matches. opt_str ( "error-format" ) . as_deref ( ) {
21112114 None | Some ( "human" ) => ErrorOutputType :: HumanReadable { color_config, .. } ,
21122115 Some ( "human-annotate-rs" ) => ErrorOutputType :: HumanReadable {
2113- kind : HumanReadableErrorType :: AnnotateSnippet { unicode : false } ,
2116+ kind : HumanReadableErrorType :: AnnotateSnippet { short : false , unicode : false } ,
21142117 color_config,
21152118 } ,
21162119 Some ( "json" ) => {
@@ -2119,11 +2122,12 @@ pub fn parse_error_format(
21192122 Some ( "pretty-json" ) => {
21202123 ErrorOutputType :: Json { pretty : true , json_rendered, color_config : json_color }
21212124 }
2122- Some ( "short" ) => {
2123- ErrorOutputType :: HumanReadable { kind : HumanReadableErrorType :: Short , color_config }
2124- }
2125+ Some ( "short" ) => ErrorOutputType :: HumanReadable {
2126+ kind : HumanReadableErrorType :: Default { short : true } ,
2127+ color_config,
2128+ } ,
21252129 Some ( "human-unicode" ) => ErrorOutputType :: HumanReadable {
2126- kind : HumanReadableErrorType :: AnnotateSnippet { unicode : true } ,
2130+ kind : HumanReadableErrorType :: AnnotateSnippet { short : false , unicode : true } ,
21272131 color_config,
21282132 } ,
21292133 Some ( arg) => {
@@ -2191,8 +2195,8 @@ fn check_error_format_stability(
21912195 let format = match format {
21922196 ErrorOutputType :: Json { pretty : true , .. } => "pretty-json" ,
21932197 ErrorOutputType :: HumanReadable { kind, .. } => match kind {
2194- HumanReadableErrorType :: AnnotateSnippet { unicode : false } => "human-annotate-rs" ,
2195- HumanReadableErrorType :: AnnotateSnippet { unicode : true } => "human-unicode" ,
2198+ HumanReadableErrorType :: AnnotateSnippet { unicode : false , .. } => "human-annotate-rs" ,
2199+ HumanReadableErrorType :: AnnotateSnippet { unicode : true , .. } => "human-unicode" ,
21962200 _ => return ,
21972201 } ,
21982202 _ => return ,
0 commit comments