Skip to content

Suggestions in errors ignore move before closure arguments #55891

Closed
@ghost

Description

Source: https://travis-ci.org/rust-lang/cargo/jobs/453802414#L938-L949

error[E0593]: closure is expected to take 1 argument, but it takes 0 arguments
   --> src/cargo/core/compiler/job_queue.rs:412:23
    |
399 |         let doit = move || {
    |                    ------- takes 0 arguments
...
412 |                 scope.spawn(doit);
    |                       ^^^^^ expected closure that takes 1 argument
help: consider changing the closure to take and ignore the expected argument
    |
399 |         let doit = |_| {
    |                    ^^^

The suggestion is to use: let doit = |_| {
But I think it should be: let doit = move |_| {

We should probably respect other modifiers like static and async, too.

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-diagnosticsArea: Messages for errors, warnings, and lints

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions