f007e6f442
There are some expressions that can be parsed as a statement without a trailing semicolon depending on the context, which can lead to confusing errors due to the same looking code being accepted in some places and not others. Identify these cases and suggest enclosing in parenthesis making the parse non-ambiguous without changing the accepted grammar.
15 lines
301 B
Plaintext
15 lines
301 B
Plaintext
error: expected pattern, found `+`
|
|
--> $DIR/match-arrows-block-then-binop.rs:5:9
|
|
|
|
|
LL | } + 5
|
|
| ^ expected pattern
|
|
help: parenthesis are required to parse this as an expression
|
|
|
|
|
LL | 0 => ({
|
|
LL | 0
|
|
LL | }) + 5
|
|
|
|
|
|
|
error: aborting due to previous error
|
|
|