Reword ambigous parse error to fit with the current error

This commit is contained in:
Esteban Küber 2019-04-30 20:37:42 -07:00
parent bff0be3784
commit 617ce2b7ee
4 changed files with 14 additions and 13 deletions

View file

@ -27,14 +27,14 @@ fn baz() -> i32 {
fn qux(a: Option<u32>, b: Option<u32>) -> bool {
(if let Some(x) = a { true } else { false })
&& //~ ERROR ambiguous parse
&& //~ ERROR expected expression
if let Some(y) = a { true } else { false }
}
fn moo(x: u32) -> bool {
(match x {
_ => 1,
}) > 0 //~ ERROR ambiguous parse
}) > 0 //~ ERROR expected expression
}
fn main() {}

View file

@ -27,14 +27,14 @@ fn baz() -> i32 {
fn qux(a: Option<u32>, b: Option<u32>) -> bool {
if let Some(x) = a { true } else { false }
&& //~ ERROR ambiguous parse
&& //~ ERROR expected expression
if let Some(y) = a { true } else { false }
}
fn moo(x: u32) -> bool {
match x {
_ => 1,
} > 0 //~ ERROR ambiguous parse
} > 0 //~ ERROR expected expression
}
fn main() {}

View file

@ -22,19 +22,19 @@ LL | { 42 } + foo;
| |
| help: parenthesis are required to parse this as an expression: `({ 42 })`
error: ambiguous parse
error: expected expression, found `&&`
--> $DIR/expr-as-stmt.rs:30:5
|
LL | if let Some(x) = a { true } else { false }
| ------------------------------------------ help: parenthesis are required to parse this as an expression: `(if let Some(x) = a { true } else { false })`
LL | &&
| ^^
| ^^ expected expression
error: ambiguous parse
error: expected expression, found `>`
--> $DIR/expr-as-stmt.rs:37:7
|
LL | } > 0
| ^
| ^ expected expression
help: parenthesis are required to parse this as an expression
|
LL | (match x {