about summary refs log tree commit diff
path: root/compiler/rustc_parse/src
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2022-05-24 14:14:41 -0700
committerMichael Goulet <michael@errs.io>2022-05-24 15:22:13 -0700
commitd61d30d9a272f8c2cce374a6f8aca5ae5d3de124 (patch)
tree0cc1974c7a036becda06814f32a6206d079140f0 /compiler/rustc_parse/src
parentfa70b89d19a52be0dea03022d807a3e615763727 (diff)
downloadrust-d61d30d9a272f8c2cce374a6f8aca5ae5d3de124.tar.gz
rust-d61d30d9a272f8c2cce374a6f8aca5ae5d3de124.zip
Minor improvement on else-no-if diagnostic
Diffstat (limited to 'compiler/rustc_parse/src')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs9
1 files changed, 1 insertions, 8 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index 37e34656941..bb6d892138a 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -2291,16 +2291,9 @@ impl<'a> Parser<'a> {
                         .span_label(else_span, "expected an `if` or a block after this `else`")
                         .span_suggestion(
                             cond.span.shrink_to_lo(),
-                            "add an `if` if this is the condition to an chained `if` statement after the `else`",
+                            "add an `if` if this is the condition of a chained `else if` statement",
                             "if ".to_string(),
                             Applicability::MaybeIncorrect,
-                        ).multipart_suggestion(
-                            "... otherwise, place this expression inside of a block if it is not an `if` condition",
-                            vec![
-                                (cond.span.shrink_to_lo(), "{ ".to_string()),
-                                (cond.span.shrink_to_hi(), " }".to_string()),
-                            ],
-                            Applicability::MaybeIncorrect,
                         )
                         .emit();
                     self.parse_if_after_cond(AttrVec::new(), cond.span.shrink_to_lo(), cond)?