@@ -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`.
@@ -2051,7 +2051,7 @@ impl JsonUnusedExterns {
20512051/// The first value returned is how to render JSON diagnostics, and the second
20522052/// is whether or not artifact notifications are enabled.
20532053pub fn parse_json ( early_dcx : & EarlyDiagCtxt , matches : & getopts:: Matches ) -> JsonConfig {
2054- let mut json_rendered = HumanReadableErrorType :: Default ;
2054+ let mut json_rendered = HumanReadableErrorType :: Default { short : false } ;
20552055 let mut json_color = ColorConfig :: Never ;
20562056 let mut json_artifact_notifications = false ;
20572057 let mut json_unused_externs = JsonUnusedExterns :: No ;
@@ -2067,9 +2067,12 @@ pub fn parse_json(early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches) -> Json
20672067
20682068 for sub_option in option. split ( ',' ) {
20692069 match sub_option {
2070- "diagnostic-short" => json_rendered = HumanReadableErrorType :: Short ,
2070+ "diagnostic-short" => {
2071+ json_rendered = HumanReadableErrorType :: Default { short : true }
2072+ }
20712073 "diagnostic-unicode" => {
2072- json_rendered = HumanReadableErrorType :: AnnotateSnippet { unicode : true } ;
2074+ json_rendered =
2075+ HumanReadableErrorType :: AnnotateSnippet { short : false , unicode : true } ;
20732076 }
20742077 "diagnostic-rendered-ansi" => json_color = ColorConfig :: Always ,
20752078 "artifacts" => json_artifact_notifications = true ,
@@ -2108,7 +2111,7 @@ pub fn parse_error_format(
21082111 match matches. opt_str ( "error-format" ) . as_deref ( ) {
21092112 None | Some ( "human" ) => ErrorOutputType :: HumanReadable { color_config, .. } ,
21102113 Some ( "human-annotate-rs" ) => ErrorOutputType :: HumanReadable {
2111- kind : HumanReadableErrorType :: AnnotateSnippet { unicode : false } ,
2114+ kind : HumanReadableErrorType :: AnnotateSnippet { short : false , unicode : false } ,
21122115 color_config,
21132116 } ,
21142117 Some ( "json" ) => {
@@ -2117,11 +2120,12 @@ pub fn parse_error_format(
21172120 Some ( "pretty-json" ) => {
21182121 ErrorOutputType :: Json { pretty : true , json_rendered, color_config : json_color }
21192122 }
2120- Some ( "short" ) => {
2121- ErrorOutputType :: HumanReadable { kind : HumanReadableErrorType :: Short , color_config }
2122- }
2123+ Some ( "short" ) => ErrorOutputType :: HumanReadable {
2124+ kind : HumanReadableErrorType :: Default { short : true } ,
2125+ color_config,
2126+ } ,
21232127 Some ( "human-unicode" ) => ErrorOutputType :: HumanReadable {
2124- kind : HumanReadableErrorType :: AnnotateSnippet { unicode : true } ,
2128+ kind : HumanReadableErrorType :: AnnotateSnippet { short : false , unicode : true } ,
21252129 color_config,
21262130 } ,
21272131 Some ( arg) => {
@@ -2189,8 +2193,8 @@ fn check_error_format_stability(
21892193 let format = match format {
21902194 ErrorOutputType :: Json { pretty : true , .. } => "pretty-json" ,
21912195 ErrorOutputType :: HumanReadable { kind, .. } => match kind {
2192- HumanReadableErrorType :: AnnotateSnippet { unicode : false } => "human-annotate-rs" ,
2193- HumanReadableErrorType :: AnnotateSnippet { unicode : true } => "human-unicode" ,
2196+ HumanReadableErrorType :: AnnotateSnippet { unicode : false , .. } => "human-annotate-rs" ,
2197+ HumanReadableErrorType :: AnnotateSnippet { unicode : true , .. } => "human-unicode" ,
21942198 _ => return ,
21952199 } ,
21962200 _ => return ,
0 commit comments