rust/compiler/rustc_lint
Yuki Okushi 88a0204fcb
Rollup merge of #111300 - Flying-Toast:while_true_span_condition, r=compiler-errors
Emit while_true lint spanning the entire loop condition

The lint that suggests `loop {}` instead of `while true {}` has functionality to 'pierce' parenthesis in cases like `while (true) {}`. In these cases, the emitted span only went to the hi of the `true` itself, not spanning the entire loop condition.

Before:
```
warning: denote infinite loops with `loop { ... }`
 --> /tmp/foobar.rs:2:5
  |
2 |     while ((((((true)))))) {}
  |     ^^^^^^^^^^^^^^^^ help: use `loop`
  |
  = note: `#[warn(while_true)]` on by default
```

After:
```
warning: denote infinite loops with `loop { ... }`
 --> /tmp/foobar.rs:2:5
  |
2 |     while ((((((true)))))) {}
  |     ^^^^^^^^^^^^^^^^^^^^^^ help: use `loop`
  |
  = note: `#[warn(while_true)]` on by default
```

This is especially a problem for rustfix.
2023-05-07 14:12:16 +09:00
..
src Rollup merge of #111300 - Flying-Toast:while_true_span_condition, r=compiler-errors 2023-05-07 14:12:16 +09:00
Cargo.toml Add `rustc_fluent_macro` to decouple fluent from `rustc_macros` 2023-04-18 18:56:22 +00:00
messages.ftl add match to diagnostic messages 2023-04-29 15:47:23 +00:00