diff options
| author | bors <bors@rust-lang.org> | 2022-05-25 11:17:34 +0000 |
|---|---|---|
| committer | bors <bors@rust-lang.org> | 2022-05-25 11:17:34 +0000 |
| commit | fe9c64d0af379e6e48ac1e798d65e2031265aa22 (patch) | |
| tree | ad52a937e49f7e13e9eb62240670e911808b7815 /compiler/rustc_parse/src/parser/expr.rs | |
| parent | 4a99c5f504ab65a0fd9d60f515811e1d9cff8c0a (diff) | |
| parent | 3c11bf3d2b345f38f920e5e7d88abead996ad775 (diff) | |
| download | rust-fe9c64d0af379e6e48ac1e798d65e2031265aa22.tar.gz rust-fe9c64d0af379e6e48ac1e798d65e2031265aa22.zip | |
Auto merge of #97388 - Dylan-DPC:rollup-tfuc4tf, r=Dylan-DPC
Rollup of 5 pull requests Successful merges: - #95953 (Modify MIR building to drop repeat expressions with length zero) - #96913 (RFC3239: Implement `cfg(target)` - Part 2) - #97233 ([RFC 2011] Library code) - #97370 (Minor improvement on else-no-if diagnostic) - #97384 (Fix metadata stats.) Failed merges: r? `@ghost` `@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_parse/src/parser/expr.rs')
| -rw-r--r-- | compiler/rustc_parse/src/parser/expr.rs | 9 |
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)? |
