From ea1a9a0e2ba1da31e2de524bf9b0a7af6b02daff Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 13 Aug 2019 11:21:09 -0700 Subject: [PATCH 1/2] Fix typo in error message. --- src/libsyntax/parse/parser/expr.rs | 2 +- src/test/ui/issues/issue-13483.stderr | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs index 4432c1329cbfe..5f04012d7103d 100644 --- a/src/libsyntax/parse/parser/expr.rs +++ b/src/libsyntax/parse/parser/expr.rs @@ -1199,7 +1199,7 @@ impl<'a> Parser<'a> { if self.eat_keyword(kw::Else) || !cond.returns() { let sp = self.sess.source_map().next_point(lo); let mut err = self.diagnostic() - .struct_span_err(sp, "missing condition for `if` statemement"); + .struct_span_err(sp, "missing condition for `if` statement"); err.span_label(sp, "expected if condition here"); return Err(err) } diff --git a/src/test/ui/issues/issue-13483.stderr b/src/test/ui/issues/issue-13483.stderr index 739f061236697..faaf8690291b7 100644 --- a/src/test/ui/issues/issue-13483.stderr +++ b/src/test/ui/issues/issue-13483.stderr @@ -1,10 +1,10 @@ -error: missing condition for `if` statemement +error: missing condition for `if` statement --> $DIR/issue-13483.rs:3:14 | LL | } else if { | ^ expected if condition here -error: missing condition for `if` statemement +error: missing condition for `if` statement --> $DIR/issue-13483.rs:10:14 | LL | } else if { From 643ddfaaa8e11b2da052681b027b24b2718d4222 Mon Sep 17 00:00:00 2001 From: Eric Huss Date: Tue, 13 Aug 2019 15:09:11 -0700 Subject: [PATCH 2/2] Apply Centril's suggestion Co-Authored-By: Mazdak Farrokhzad --- src/libsyntax/parse/parser/expr.rs | 2 +- src/test/ui/issues/issue-13483.stderr | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libsyntax/parse/parser/expr.rs b/src/libsyntax/parse/parser/expr.rs index 5f04012d7103d..7f6406a89fb5a 100644 --- a/src/libsyntax/parse/parser/expr.rs +++ b/src/libsyntax/parse/parser/expr.rs @@ -1199,7 +1199,7 @@ impl<'a> Parser<'a> { if self.eat_keyword(kw::Else) || !cond.returns() { let sp = self.sess.source_map().next_point(lo); let mut err = self.diagnostic() - .struct_span_err(sp, "missing condition for `if` statement"); + .struct_span_err(sp, "missing condition for `if` expression"); err.span_label(sp, "expected if condition here"); return Err(err) } diff --git a/src/test/ui/issues/issue-13483.stderr b/src/test/ui/issues/issue-13483.stderr index faaf8690291b7..df9f1dd0115db 100644 --- a/src/test/ui/issues/issue-13483.stderr +++ b/src/test/ui/issues/issue-13483.stderr @@ -1,10 +1,10 @@ -error: missing condition for `if` statement +error: missing condition for `if` expression --> $DIR/issue-13483.rs:3:14 | LL | } else if { | ^ expected if condition here -error: missing condition for `if` statement +error: missing condition for `if` expression --> $DIR/issue-13483.rs:10:14 | LL | } else if {