Skip to content

Commit

Permalink
Never inline HideCodeAlways suggestions
Browse files Browse the repository at this point in the history
  • Loading branch information
estebank committed Feb 11, 2019
1 parent 6ea159e commit 7cfba1c
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/librustc_errors/emitter.rs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,10 @@ impl Emitter for EmitterWriter {
// don't display long messages as labels
sugg.msg.split_whitespace().count() < 10 &&
// don't display multiline suggestions as labels
!sugg.substitutions[0].parts[0].snippet.contains('\n') {
!sugg.substitutions[0].parts[0].snippet.contains('\n') &&
// when this style is set we want the suggestion to be a message, not inline
sugg.style != SuggestionStyle::HideCodeAlways
{
let substitution = &sugg.substitutions[0].parts[0].snippet.trim();
let msg = if substitution.len() == 0 || sugg.style.hide_inline() {
// This substitution is only removal or we explicitly don't want to show the
Expand Down

0 comments on commit 7cfba1c

Please sign in to comment.