@@ -826,7 +826,7 @@ pub enum ErrorOutputType {
826826 /// Output meant for the consumption of humans.
827827 #[ default]
828828 HumanReadable {
829- kind : HumanReadableErrorType = HumanReadableErrorType :: Default ,
829+ kind : HumanReadableErrorType = HumanReadableErrorType :: Default { short : false } ,
830830 color_config: ColorConfig = ColorConfig :: Auto ,
831831 } ,
832832 /// Output that's consumed by other tools such as `rustfix` or the `RLS`.
@@ -2042,7 +2042,7 @@ impl JsonUnusedExterns {
20422042/// The first value returned is how to render JSON diagnostics, and the second
20432043/// is whether or not artifact notifications are enabled.
20442044pub fn parse_json ( early_dcx : & EarlyDiagCtxt , matches : & getopts:: Matches ) -> JsonConfig {
2045- let mut json_rendered = HumanReadableErrorType :: Default ;
2045+ let mut json_rendered = HumanReadableErrorType :: Default { short : false } ;
20462046 let mut json_color = ColorConfig :: Never ;
20472047 let mut json_artifact_notifications = false ;
20482048 let mut json_unused_externs = JsonUnusedExterns :: No ;
@@ -2058,9 +2058,12 @@ pub fn parse_json(early_dcx: &EarlyDiagCtxt, matches: &getopts::Matches) -> Json
20582058
20592059 for sub_option in option. split ( ',' ) {
20602060 match sub_option {
2061- "diagnostic-short" => json_rendered = HumanReadableErrorType :: Short ,
2061+ "diagnostic-short" => {
2062+ json_rendered = HumanReadableErrorType :: Default { short : true }
2063+ }
20622064 "diagnostic-unicode" => {
2063- json_rendered = HumanReadableErrorType :: AnnotateSnippet { unicode : true } ;
2065+ json_rendered =
2066+ HumanReadableErrorType :: AnnotateSnippet { short : false , unicode : true } ;
20642067 }
20652068 "diagnostic-rendered-ansi" => json_color = ColorConfig :: Always ,
20662069 "artifacts" => json_artifact_notifications = true ,
@@ -2099,7 +2102,7 @@ pub fn parse_error_format(
20992102 match matches. opt_str ( "error-format" ) . as_deref ( ) {
21002103 None | Some ( "human" ) => ErrorOutputType :: HumanReadable { color_config, .. } ,
21012104 Some ( "human-annotate-rs" ) => ErrorOutputType :: HumanReadable {
2102- kind : HumanReadableErrorType :: AnnotateSnippet { unicode : false } ,
2105+ kind : HumanReadableErrorType :: AnnotateSnippet { short : false , unicode : false } ,
21032106 color_config,
21042107 } ,
21052108 Some ( "json" ) => {
@@ -2108,11 +2111,12 @@ pub fn parse_error_format(
21082111 Some ( "pretty-json" ) => {
21092112 ErrorOutputType :: Json { pretty : true , json_rendered, color_config : json_color }
21102113 }
2111- Some ( "short" ) => {
2112- ErrorOutputType :: HumanReadable { kind : HumanReadableErrorType :: Short , color_config }
2113- }
2114+ Some ( "short" ) => ErrorOutputType :: HumanReadable {
2115+ kind : HumanReadableErrorType :: Default { short : true } ,
2116+ color_config,
2117+ } ,
21142118 Some ( "human-unicode" ) => ErrorOutputType :: HumanReadable {
2115- kind : HumanReadableErrorType :: AnnotateSnippet { unicode : true } ,
2119+ kind : HumanReadableErrorType :: AnnotateSnippet { short : false , unicode : true } ,
21162120 color_config,
21172121 } ,
21182122 Some ( arg) => {
@@ -2180,8 +2184,8 @@ fn check_error_format_stability(
21802184 let format = match format {
21812185 ErrorOutputType :: Json { pretty : true , .. } => "pretty-json" ,
21822186 ErrorOutputType :: HumanReadable { kind, .. } => match kind {
2183- HumanReadableErrorType :: AnnotateSnippet { unicode : false } => "human-annotate-rs" ,
2184- HumanReadableErrorType :: AnnotateSnippet { unicode : true } => "human-unicode" ,
2187+ HumanReadableErrorType :: AnnotateSnippet { unicode : false , .. } => "human-annotate-rs" ,
2188+ HumanReadableErrorType :: AnnotateSnippet { unicode : true , .. } => "human-unicode" ,
21852189 _ => return ,
21862190 } ,
21872191 _ => return ,
0 commit comments