Skip to content

Commit f31316f

Browse files
committed
Auto merge of #116962 - estebank:issue-63835, r=oli-obk
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">
2 parents c7f3948 + fd49590 commit f31316f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Diff for: compiler/rustc_errors/src/emitter.rs

+8-1
Original file line numberDiff line numberDiff line change
@@ -1348,7 +1348,14 @@ impl EmitterWriter {
13481348
buffer.append(0, "]", Style::Level(*level));
13491349
label_width += 2 + code.len();
13501350
}
1351-
let header_style = if is_secondary { Style::HeaderMsg } else { Style::MainHeaderMsg };
1351+
let header_style = if is_secondary {
1352+
Style::HeaderMsg
1353+
} else if self.short_message {
1354+
// For short messages avoid bolding the message, as it doesn't look great (#63835).
1355+
Style::NoStyle
1356+
} else {
1357+
Style::MainHeaderMsg
1358+
};
13521359
if *level != Level::FailureNote {
13531360
buffer.append(0, ": ", header_style);
13541361
label_width += 2;

0 commit comments

Comments
 (0)