rust/compiler/rustc_parse
Matthias Krüger dbb9e224af
Rollup merge of #91435 - FabianWolff:issue-91421-if-then, r=lcnr
Improve diagnostic for missing half of binary operator in `if` condition

Fixes #91421. I've also changed it so that it doesn't consume the `else` token in the error case, because it will try to consume it again afterwards, leading to this incorrect error message (where the `else` reported as missing is actually there):
```
error: expected one of `.`, `;`, `?`, `else`, or an operator, found `{`
 --> src/main.rs:4:12
  |
4 |     } else { 4 };
  |            ^ expected one of `.`, `;`, `?`, `else`, or an operator
```

r? `@lcnr`
2021-12-02 22:16:13 +01:00
..
src Rollup merge of #91435 - FabianWolff:issue-91421-if-then, r=lcnr 2021-12-02 22:16:13 +01:00
Cargo.toml Lint against RTL unicode codepoints in literals and comments 2021-10-31 13:14:04 +01:00