Skip to content

Commit

Permalink
Small note on the test
Browse files Browse the repository at this point in the history
  • Loading branch information
dnbln committed Nov 7, 2023
1 parent 8081a3d commit e80c3ba
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 9 deletions.
4 changes: 4 additions & 0 deletions tests/ui/needless_move.fixed
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! To properly check that the `needless_move` lint is complete, go to the
//! `.fixed` file of this test and check that the code fails to compile if
//! any of the `move`s are removed.
#![warn(clippy::needless_move)]

#[derive(Copy, Clone)]
Expand Down
4 changes: 4 additions & 0 deletions tests/ui/needless_move.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
//! To properly check that the `needless_move` lint is complete, go to the
//! `.fixed` file of this test and check that the code fails to compile if
//! any of the `move`s are removed.
#![warn(clippy::needless_move)]

#[derive(Copy, Clone)]
Expand Down
18 changes: 9 additions & 9 deletions tests/ui/needless_move.stderr
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
error: you seem to use `move`, but the `move` is unnecessary
--> $DIR/needless_move.rs:46:33
--> $DIR/needless_move.rs:50:33
|
LL | let closure = assert_static(move || {});
| -----^^^^^
Expand All @@ -11,7 +11,7 @@ LL | let closure = assert_static(move || {});
= help: to override `-D warnings` add `#[allow(clippy::needless_move)]`

error: you seem to use `move`, but the `move` is unnecessary
--> $DIR/needless_move.rs:47:29
--> $DIR/needless_move.rs:51:29
|
LL | let fut = assert_static(async move {});
| ^^^^^^-----^^
Expand All @@ -21,7 +21,7 @@ LL | let fut = assert_static(async move {});
= note: There were no captured variables, so the move is redundant

error: you seem to use `move`, but the `move` is unnecessary
--> $DIR/needless_move.rs:51:33
--> $DIR/needless_move.rs:55:33
|
LL | let closure = assert_static(move || {
| ^----
Expand All @@ -35,7 +35,7 @@ LL | | });
= note: There were consumed variables, but none borrowed, so the move is redundant

error: you seem to use `move`, but the `move` is unnecessary
--> $DIR/needless_move.rs:97:29
--> $DIR/needless_move.rs:101:29
|
LL | let fut = assert_static(async move {
| ^ ----- help: remove the `move`
Expand All @@ -48,7 +48,7 @@ LL | | });
= note: There were consumed variables, but none borrowed, so the move is redundant

error: you seem to use `move`, but the `move` is unnecessary
--> $DIR/needless_move.rs:134:33
--> $DIR/needless_move.rs:138:33
|
LL | let closure = assert_static(move || {
| ^----
Expand All @@ -63,7 +63,7 @@ LL | | });
= note: There were consumed variables, but none borrowed, so the move is redundant

error: you seem to use `move`, but the `move` is unnecessary
--> $DIR/needless_move.rs:148:33
--> $DIR/needless_move.rs:152:33
|
LL | let closure = assert_static(move || {
| ^----
Expand All @@ -78,7 +78,7 @@ LL | | });
= note: There were consumed variables, but none borrowed, so the move is redundant

error: you seem to use `move`, but the `move` is unnecessary
--> $DIR/needless_move.rs:163:33
--> $DIR/needless_move.rs:167:33
|
LL | let closure = assert_static(move || {
| ^----
Expand All @@ -94,7 +94,7 @@ LL | | });
= note: There were consumed variables, but none borrowed, so the move is redundant

error: you seem to use `move`, but the `move` is unnecessary
--> $DIR/needless_move.rs:182:33
--> $DIR/needless_move.rs:186:33
|
LL | let closure = assert_static(move || {
| ^----
Expand All @@ -108,7 +108,7 @@ LL | | });
= note: There were consumed variables, but none borrowed, so the move is redundant

error: you seem to use `move`, but the `move` is unnecessary
--> $DIR/needless_move.rs:220:33
--> $DIR/needless_move.rs:224:33
|
LL | let closure = assert_static(move || {
| ^----
Expand Down

0 comments on commit e80c3ba

Please sign in to comment.