rust/src/test/ui/parser/match-arrows-block-then-binop.rs
Esteban Küber f007e6f442 Identify when a stmt could have been parsed as an expr
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.
2019-04-29 14:07:02 -07:00

8 lines
116 B
Rust

fn main() {
let _ = match 0 {
0 => {
0
} + 5 //~ ERROR expected pattern, found `+`
};
}