diff options
| author | bors <bors@rust-lang.org> | 2023-10-20 10:52:24 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2023-10-20 10:52:24 +0000 |
| commit | f31316f7a99785ae6958110af095beadb08038ea (patch) | |
| tree | a001cdf93557c1f79d15fee1da6c83e073d243db /compiler/rustc_errors | |
| parent | c7f3948028cf5bcbfd2ba2fb511186c0f72e4d26 (diff) | |
| parent | fd49590ee0585e106b073a4aa57df9e29c6067c4 (diff) | |
| download | rust-f31316f7a99785ae6958110af095beadb08038ea.tar.gz rust-f31316f7a99785ae6958110af095beadb08038ea.zip | |
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">
Diffstat (limited to 'compiler/rustc_errors')
| -rw-r--r-- | compiler/rustc_errors/src/emitter.rs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/compiler/rustc_errors/src/emitter.rs b/compiler/rustc_errors/src/emitter.rs index d3ce3617dd6..6d95fbcfad0 100644 --- a/compiler/rustc_errors/src/emitter.rs +++ b/compiler/rustc_errors/src/emitter.rs @@ -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; |
