Skip to content

Commit 7c86faa

Browse files
authored
test(while_immutable_condition): call the test file the same as the lint (#15981)
changelog: none
2 parents 35e55a6 + c95db07 commit 7c86faa

File tree

2 files changed

+15
-12
lines changed

2 files changed

+15
-12
lines changed

tests/ui/infinite_loop.rs renamed to tests/ui/while_immutable_condition.rs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
#![warn(clippy::while_immutable_condition)]
2+
13
fn fn_val(i: i32) -> i32 {
24
unimplemented!()
35
}

tests/ui/infinite_loop.stderr renamed to tests/ui/while_immutable_condition.stderr

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,79 @@
11
error: variables in the condition are not mutated in the loop body
2-
--> tests/ui/infinite_loop.rs:20:11
2+
--> tests/ui/while_immutable_condition.rs:22:11
33
|
44
LL | while y < 10 {
55
| ^^^^^^
66
|
77
= note: this may lead to an infinite or to a never running loop
8-
= note: `#[deny(clippy::while_immutable_condition)]` on by default
8+
= note: `-D clippy::while-immutable-condition` implied by `-D warnings`
9+
= help: to override `-D warnings` add `#[allow(clippy::while_immutable_condition)]`
910

1011
error: variables in the condition are not mutated in the loop body
11-
--> tests/ui/infinite_loop.rs:27:11
12+
--> tests/ui/while_immutable_condition.rs:29:11
1213
|
1314
LL | while y < 10 && x < 3 {
1415
| ^^^^^^^^^^^^^^^
1516
|
1617
= note: this may lead to an infinite or to a never running loop
1718

1819
error: variables in the condition are not mutated in the loop body
19-
--> tests/ui/infinite_loop.rs:36:11
20+
--> tests/ui/while_immutable_condition.rs:38:11
2021
|
2122
LL | while !cond {
2223
| ^^^^^
2324
|
2425
= note: this may lead to an infinite or to a never running loop
2526

2627
error: variables in the condition are not mutated in the loop body
27-
--> tests/ui/infinite_loop.rs:82:11
28+
--> tests/ui/while_immutable_condition.rs:84:11
2829
|
2930
LL | while i < 3 {
3031
| ^^^^^
3132
|
3233
= note: this may lead to an infinite or to a never running loop
3334

3435
error: variables in the condition are not mutated in the loop body
35-
--> tests/ui/infinite_loop.rs:89:11
36+
--> tests/ui/while_immutable_condition.rs:91:11
3637
|
3738
LL | while i < 3 && j > 0 {
3839
| ^^^^^^^^^^^^^^
3940
|
4041
= note: this may lead to an infinite or to a never running loop
4142

4243
error: variables in the condition are not mutated in the loop body
43-
--> tests/ui/infinite_loop.rs:95:11
44+
--> tests/ui/while_immutable_condition.rs:97:11
4445
|
4546
LL | while i < 3 {
4647
| ^^^^^
4748
|
4849
= note: this may lead to an infinite or to a never running loop
4950

5051
error: variables in the condition are not mutated in the loop body
51-
--> tests/ui/infinite_loop.rs:112:11
52+
--> tests/ui/while_immutable_condition.rs:114:11
5253
|
5354
LL | while i < 3 {
5455
| ^^^^^
5556
|
5657
= note: this may lead to an infinite or to a never running loop
5758

5859
error: variables in the condition are not mutated in the loop body
59-
--> tests/ui/infinite_loop.rs:119:11
60+
--> tests/ui/while_immutable_condition.rs:121:11
6061
|
6162
LL | while i < 3 {
6263
| ^^^^^
6364
|
6465
= note: this may lead to an infinite or to a never running loop
6566

6667
error: variables in the condition are not mutated in the loop body
67-
--> tests/ui/infinite_loop.rs:187:15
68+
--> tests/ui/while_immutable_condition.rs:189:15
6869
|
6970
LL | while self.count < n {
7071
| ^^^^^^^^^^^^^^
7172
|
7273
= note: this may lead to an infinite or to a never running loop
7374

7475
error: variables in the condition are not mutated in the loop body
75-
--> tests/ui/infinite_loop.rs:197:11
76+
--> tests/ui/while_immutable_condition.rs:199:11
7677
|
7778
LL | while y < 10 {
7879
| ^^^^^^
@@ -82,7 +83,7 @@ LL | while y < 10 {
8283
= help: rewrite it as `if cond { loop { } }`
8384

8485
error: variables in the condition are not mutated in the loop body
85-
--> tests/ui/infinite_loop.rs:206:11
86+
--> tests/ui/while_immutable_condition.rs:208:11
8687
|
8788
LL | while y < 10 {
8889
| ^^^^^^

0 commit comments

Comments
 (0)