]> git.lizzy.rs Git - rust.git/commitdiff
Never inline HideCodeAlways suggestions
authorEsteban Küber <esteban@kuber.com.ar>
Fri, 8 Feb 2019 11:02:42 +0000 (03:02 -0800)
committerEsteban Küber <esteban@kuber.com.ar>
Mon, 11 Feb 2019 18:01:40 +0000 (10:01 -0800)
src/librustc_errors/emitter.rs

index 5696b2eee8956a7355f97859494035b2818d20c8..6e4119609988786a156c31d487427fd7c137d59b 100644 (file)
@@ -46,7 +46,10 @@ fn emit(&mut self, db: &DiagnosticBuilder<'_>) {
                // 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