Skip to content

Commit 7cfba1c

Browse files
committed
Never inline HideCodeAlways suggestions
1 parent 6ea159e commit 7cfba1c

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/librustc_errors/emitter.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,10 @@ impl Emitter for EmitterWriter {
4646
// don't display long messages as labels
4747
sugg.msg.split_whitespace().count() < 10 &&
4848
// don't display multiline suggestions as labels
49-
!sugg.substitutions[0].parts[0].snippet.contains('\n') {
49+
!sugg.substitutions[0].parts[0].snippet.contains('\n') &&
50+
// when this style is set we want the suggestion to be a message, not inline
51+
sugg.style != SuggestionStyle::HideCodeAlways
52+
{
5053
let substitution = &sugg.substitutions[0].parts[0].snippet.trim();
5154
let msg = if substitution.len() == 0 || sugg.style.hide_inline() {
5255
// This substitution is only removal or we explicitly don't want to show the

0 commit comments

Comments
 (0)