Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

False positive with redundant_clone lint #5690

Closed
Heychsea opened this issue Jun 6, 2020 · 1 comment
Closed

False positive with redundant_clone lint #5690

Heychsea opened this issue Jun 6, 2020 · 1 comment

Comments

@Heychsea
Copy link

Heychsea commented Jun 6, 2020

Hello, after updating to Rust stable 1.44.0 (and clippy with it) via rustup, I have encountered a false positive with the redundant_clone lint.

fn foo(_: threadpool::ThreadPool) {
  // Do something with the pool
}

fn main() {
    let pool = threadpool::ThreadPool::new(4);
    pool.clone().execute(move || {
        foo(pool)
    })
}

Here is a link to the playground, I don't really know how to explain what is happening but I know that it is not possible to remove the clone in my example as I am moving the value while borrowing it.

Thanks!

Here is my clippy version:

❯ cargo clippy -V                                                         
clippy 0.0.212 (d4092ace 2020-05-11)
@Heychsea Heychsea changed the title False posivite with redundant_clone lint False positive with redundant_clone lint Jun 6, 2020
@flip1995
Copy link
Member

flip1995 commented Jun 6, 2020

Duplicate of #5595

@flip1995 flip1995 marked this as a duplicate of #5595 Jun 6, 2020
@flip1995 flip1995 closed this as completed Jun 6, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants