about summary refs log tree commit diff
path: root/compiler/rustc_parse/src/parser
diff options
context:
space:
mode:
authorMatthias Krüger <matthias.krueger@famsik.de>2023-02-01 05:54:39 +0100
committerGitHub <noreply@github.com>2023-02-01 05:54:39 +0100
commit6390d25eab41efdbb96e6d42a67fd98d64469317 (patch)
tree16a73c5eac8d2e2f5a099fb8c2936e20c1711fc0 /compiler/rustc_parse/src/parser
parentb853b22270c794e8f2b76e346173d9387cfff0c1 (diff)
parente905b937060e3c920d85d1ae09d1e3a9a5f5a190 (diff)
downloadrust-6390d25eab41efdbb96e6d42a67fd98d64469317.tar.gz
rust-6390d25eab41efdbb96e6d42a67fd98d64469317.zip
Rollup merge of #107487 - edward-shen:edward-shen/107213-round-2, r=estebank
Make the "extra if in let...else block" hint a suggestion

Changes the hint to a suggestion, suggested in #107213.

r? ```@estebank```
Diffstat (limited to 'compiler/rustc_parse/src/parser')
-rw-r--r--compiler/rustc_parse/src/parser/expr.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_parse/src/parser/expr.rs b/compiler/rustc_parse/src/parser/expr.rs
index dcc3059a7f4..500d7d77071 100644
--- a/compiler/rustc_parse/src/parser/expr.rs
+++ b/compiler/rustc_parse/src/parser/expr.rs
@@ -2290,7 +2290,7 @@ impl<'a> Parser<'a> {
                 block
             } else {
                 let let_else_sub = matches!(cond.kind, ExprKind::Let(..))
-                    .then(|| IfExpressionLetSomeSub { if_span: lo });
+                    .then(|| IfExpressionLetSomeSub { if_span: lo.until(cond_span) });
 
                 self.sess.emit_err(IfExpressionMissingThenBlock {
                     if_span: lo,