mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-23 23:34:48 +00:00
faa797e7e7
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 ``` |
||
---|---|---|
.. | ||
src | ||
Cargo.toml | ||
messages.ftl |