diff options
author | Flying-Toast <38232168+Flying-Toast@users.noreply.github.com> | 2023-05-06 14:12:00 -0400 |
---|---|---|
committer | Flying-Toast <38232168+Flying-Toast@users.noreply.github.com> | 2023-05-06 17:05:53 -0400 |
commit | faa797e7e7bd75fd7dfd5a08fe8cf7bf82e02fd8 (patch) | |
tree | 4c2395c22c39c5252c645f4cd2cf25f620d1042e /tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs | |
parent | dd9a7bf848e412c81e3045245acbd5a01641a610 (diff) | |
download | rust-faa797e7e7bd75fd7dfd5a08fe8cf7bf82e02fd8.tar.gz |
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
```
Diffstat (limited to 'tests/codegen/src-hash-algorithm/src-hash-algorithm-sha1.rs')
0 files changed, 0 insertions, 0 deletions