rust/compiler/rustc_parse/src
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
..
lexer Implement RFC 3503: frontmatters 2025-05-05 23:10:08 +08:00
parser Improve ternary operator recovery 2025-05-14 13:32:59 +01:00
errors.rs Improve ternary operator recovery 2025-05-14 13:32:59 +01:00
lib.rs update cfg(bootstrap) 2025-05-12 15:33:37 +02:00
validate_attr.rs Make attribute safety validation logic more obvious 2025-05-04 21:44:50 +08:00