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.
8 lines
116 B
Rust
8 lines
116 B
Rust
fn main() {
|
|
let _ = match 0 {
|
|
0 => {
|
|
0
|
|
} + 5 //~ ERROR expected pattern, found `+`
|
|
};
|
|
}
|