mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-29 10:13:54 +00:00
3325ba640c
Recover parentheses in range patterns Before: ```rs match n { (0).. => (), _ => () } ``` ``` error: expected one of `=>`, `if`, or `|`, found `..` --> src/lib.rs:3:12 | 3 | (0).. => (), | ^^ expected one of `=>`, `if`, or `|` ``` After: ``` error: range pattern bounds cannot have parentheses --> main.rs:3:5 | 3 | (0).. => (), | ^ ^ | help: remove these parentheses | 3 - (0).. => (), 3 + 0.. => (), | ``` This sets the groundwork for #118625, which will extend the recovery to expressions like `(0 + 1)..` where users may tend to add parentheses to avoid dealing with precedence. --- ```@rustbot``` label +A-parser +A-patterns +A-diagnostics |
||
---|---|---|
.. | ||
assembly | ||
auxiliary | ||
codegen | ||
codegen-units | ||
coverage | ||
coverage-run-rustdoc | ||
debuginfo | ||
incremental | ||
mir-opt | ||
pretty | ||
run-make | ||
run-make-fulldeps | ||
run-pass-valgrind | ||
rustdoc | ||
rustdoc-gui | ||
rustdoc-js | ||
rustdoc-js-std | ||
rustdoc-json | ||
rustdoc-ui | ||
ui | ||
ui-fulldeps | ||
COMPILER_TESTS.md |