Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
dnbln committed Nov 18, 2023
1 parent b932571 commit 7a949c3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 11 deletions.
3 changes: 1 addition & 2 deletions tests/ui/needless_move.fixed
Original file line number Diff line number Diff line change
Expand Up @@ -50,8 +50,7 @@ fn main() {

// (an async fn is a fn whose body turns into an `async move {}` block, where the `move` kw has
// DUMMY_SP as the Span). It shouldn't trigger the lint.
async fn f() {
}
async fn f() {}

// triggers on move closures and async blocks which do not capture anything
let closure = assert_static(|| {});
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:57:33
--> $DIR/needless_move.rs:56: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:58:29
--> $DIR/needless_move.rs:57: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 unnecessary

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

error: you seem to use `move`, but the `move` is unnecessary
--> $DIR/needless_move.rs:108:29
--> $DIR/needless_move.rs:107: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 no borrowed variables, so the `move` is unnecessary

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

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

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

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

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

0 comments on commit 7a949c3

Please sign in to comment.