Reword ambigous parse error to fit with the current error
This commit is contained in:
parent
bff0be3784
commit
617ce2b7ee
4 changed files with 14 additions and 13 deletions
|
|
@ -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() {}
|
||||
|
|
|
|||
|
|
@ -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() {}
|
||||
|
|
|
|||
|
|
@ -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 {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue