Skip to content

Commit e80c3ba

Browse files
committed
Small note on the test
1 parent 8081a3d commit e80c3ba

File tree

3 files changed

+17
-9
lines changed

3 files changed

+17
-9
lines changed

tests/ui/needless_move.fixed

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
//! To properly check that the `needless_move` lint is complete, go to the
2+
//! `.fixed` file of this test and check that the code fails to compile if
3+
//! any of the `move`s are removed.
4+
15
#![warn(clippy::needless_move)]
26

37
#[derive(Copy, Clone)]

tests/ui/needless_move.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
//! To properly check that the `needless_move` lint is complete, go to the
2+
//! `.fixed` file of this test and check that the code fails to compile if
3+
//! any of the `move`s are removed.
4+
15
#![warn(clippy::needless_move)]
26

37
#[derive(Copy, Clone)]

tests/ui/needless_move.stderr

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
error: you seem to use `move`, but the `move` is unnecessary
2-
--> $DIR/needless_move.rs:46:33
2+
--> $DIR/needless_move.rs:50:33
33
|
44
LL | let closure = assert_static(move || {});
55
| -----^^^^^
@@ -11,7 +11,7 @@ LL | let closure = assert_static(move || {});
1111
= help: to override `-D warnings` add `#[allow(clippy::needless_move)]`
1212

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

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

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

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

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

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

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

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

0 commit comments

Comments
 (0)