rust/compiler/rustc_parse
Matthias Krüger e53b9f8fdd
Rollup merge of #141003 - clubby789:ternary-improve, r=compiler-errors
Improve ternary operator recovery

This
- Improves the span of the error to not point at the next token
- Where possible, we use the span of the condition to further improve the span of the error to include the cond, and suggest a maybe-incorrect fix

Currently this works on free expressions, not let statements; some more refactoring would be needed to pass the span down, which I'm not sure is worth doing.

### Old
![image](https://github.com/user-attachments/assets/5688cefc-e4ef-4135-a5ba-340ce05ae6f3)

### New
![image](https://github.com/user-attachments/assets/154f5380-e0c8-42c7-9bf8-0adb3d0433fa)
2025-05-16 07:19:41 +02:00
..
src Rollup merge of #141003 - clubby789:ternary-improve, r=compiler-errors 2025-05-16 07:19:41 +02:00
Cargo.toml Update rustc-literal-escaper version to 0.0.2 2025-04-04 22:26:10 +02:00
messages.ftl Improve ternary operator recovery 2025-05-14 13:32:59 +01:00