| // compile-flags: --error-format json -Zunstable-options |
| // The output for humans should just highlight the whole span without showing |
| // the suggested replacement, but we also want to test that suggested |
| // replacement only removes one set of parentheses, rather than naïvely |
| // stripping away any starting or ending parenthesis characters—hence this |
| // test of the JSON error format. |
| #![allow(unreachable_code)] |
| if _b { //~ ERROR unnecessary parentheses |
| if c { //~ ERROR unnecessary parentheses |
| if c { //~ ERROR unnecessary parentheses |
| if c { //~ ERROR unnecessary parentheses |
| while true && false { //~ ERROR unnecessary parentheses |
| for _ in 0 .. 3 { //~ ERROR unnecessary parentheses |
| for _ in 0 .. 3 { //~ ERROR unnecessary parentheses |
| while true && false { //~ ERROR unnecessary parentheses |
| if (break { return true }) { |