Skip to content

Commit

Permalink
Auto merge of #116962 - estebank:issue-63835, r=oli-obk
Browse files Browse the repository at this point in the history
Do not bold main message in `--error-format=short`

Fix #63835.

Before:

<img width="484" alt="Screenshot 2023-10-19 at 3 52 53 PM" src="https://github.com/rust-lang/rust/assets/1606434/9bd6cbd5-a4ce-4cc3-8c5f-60a8d3ad38da">

After:

<img width="492" alt="Screenshot 2023-10-19 at 3 52 32 PM" src="https://github.com/rust-lang/rust/assets/1606434/0cf2417a-08f2-4074-860c-a88a838a4209">
  • Loading branch information
bors committed Oct 20, 2023
2 parents c7f3948 + fd49590 commit f31316f
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion compiler/rustc_errors/src/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1348,7 +1348,14 @@ impl EmitterWriter {
buffer.append(0, "]", Style::Level(*level));
label_width += 2 + code.len();
}
let header_style = if is_secondary { Style::HeaderMsg } else { Style::MainHeaderMsg };
let header_style = if is_secondary {
Style::HeaderMsg
} else if self.short_message {
// For short messages avoid bolding the message, as it doesn't look great (#63835).
Style::NoStyle
} else {
Style::MainHeaderMsg
};
if *level != Level::FailureNote {
buffer.append(0, ": ", header_style);
label_width += 2;
Expand Down

0 comments on commit f31316f

Please sign in to comment.