test(while_immutable_condition): call the test file the same as the lint

This commit is contained in:
Ada Alakbarova 2025-10-29 19:13:17 +01:00
parent 35e55a63f2
commit c95db073b6
No known key found for this signature in database
2 changed files with 15 additions and 12 deletions

View file

@ -1,3 +1,5 @@
#![warn(clippy::while_immutable_condition)]
fn fn_val(i: i32) -> i32 {
unimplemented!()
}

View file

@ -1,14 +1,15 @@
error: variables in the condition are not mutated in the loop body
--> tests/ui/infinite_loop.rs:20:11
--> tests/ui/while_immutable_condition.rs:22:11
|
LL | while y < 10 {
| ^^^^^^
|
= note: this may lead to an infinite or to a never running loop
= note: `#[deny(clippy::while_immutable_condition)]` on by default
= note: `-D clippy::while-immutable-condition` implied by `-D warnings`
= help: to override `-D warnings` add `#[allow(clippy::while_immutable_condition)]`
error: variables in the condition are not mutated in the loop body
--> tests/ui/infinite_loop.rs:27:11
--> tests/ui/while_immutable_condition.rs:29:11
|
LL | while y < 10 && x < 3 {
| ^^^^^^^^^^^^^^^
@ -16,7 +17,7 @@ LL | while y < 10 && x < 3 {
= note: this may lead to an infinite or to a never running loop
error: variables in the condition are not mutated in the loop body
--> tests/ui/infinite_loop.rs:36:11
--> tests/ui/while_immutable_condition.rs:38:11
|
LL | while !cond {
| ^^^^^
@ -24,7 +25,7 @@ LL | while !cond {
= note: this may lead to an infinite or to a never running loop
error: variables in the condition are not mutated in the loop body
--> tests/ui/infinite_loop.rs:82:11
--> tests/ui/while_immutable_condition.rs:84:11
|
LL | while i < 3 {
| ^^^^^
@ -32,7 +33,7 @@ LL | while i < 3 {
= note: this may lead to an infinite or to a never running loop
error: variables in the condition are not mutated in the loop body
--> tests/ui/infinite_loop.rs:89:11
--> tests/ui/while_immutable_condition.rs:91:11
|
LL | while i < 3 && j > 0 {
| ^^^^^^^^^^^^^^
@ -40,7 +41,7 @@ LL | while i < 3 && j > 0 {
= note: this may lead to an infinite or to a never running loop
error: variables in the condition are not mutated in the loop body
--> tests/ui/infinite_loop.rs:95:11
--> tests/ui/while_immutable_condition.rs:97:11
|
LL | while i < 3 {
| ^^^^^
@ -48,7 +49,7 @@ LL | while i < 3 {
= note: this may lead to an infinite or to a never running loop
error: variables in the condition are not mutated in the loop body
--> tests/ui/infinite_loop.rs:112:11
--> tests/ui/while_immutable_condition.rs:114:11
|
LL | while i < 3 {
| ^^^^^
@ -56,7 +57,7 @@ LL | while i < 3 {
= note: this may lead to an infinite or to a never running loop
error: variables in the condition are not mutated in the loop body
--> tests/ui/infinite_loop.rs:119:11
--> tests/ui/while_immutable_condition.rs:121:11
|
LL | while i < 3 {
| ^^^^^
@ -64,7 +65,7 @@ LL | while i < 3 {
= note: this may lead to an infinite or to a never running loop
error: variables in the condition are not mutated in the loop body
--> tests/ui/infinite_loop.rs:187:15
--> tests/ui/while_immutable_condition.rs:189:15
|
LL | while self.count < n {
| ^^^^^^^^^^^^^^
@ -72,7 +73,7 @@ LL | while self.count < n {
= note: this may lead to an infinite or to a never running loop
error: variables in the condition are not mutated in the loop body
--> tests/ui/infinite_loop.rs:197:11
--> tests/ui/while_immutable_condition.rs:199:11
|
LL | while y < 10 {
| ^^^^^^
@ -82,7 +83,7 @@ LL | while y < 10 {
= help: rewrite it as `if cond { loop { } }`
error: variables in the condition are not mutated in the loop body
--> tests/ui/infinite_loop.rs:206:11
--> tests/ui/while_immutable_condition.rs:208:11
|
LL | while y < 10 {
| ^^^^^^