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

Strange sort-of-regression in a single lint: clippy::redundant-clone #5014

Closed
mulkieran opened this issue Jan 7, 2020 · 1 comment · Fixed by #5017
Closed

Strange sort-of-regression in a single lint: clippy::redundant-clone #5014

mulkieran opened this issue Jan 7, 2020 · 1 comment · Fixed by #5017

Comments

@mulkieran
Copy link

The evidence is here:

https://travis-ci.org/stratis-storage/stratisd/builds/633945478?utm_source=github_status&utm_medium=notification

There is one failure, clippy task on 1.40. There is just a single error reported. What makes this interesting is:

  1. We ran the identical clippy test on Rust beta and it succeeded. That's the bottom mandatory Travis target.
  2. we know it wasn't a failure on clippy task for 1.39 which was run on the same code just shortly before:
https://travis-ci.org/stratis-storage/stratisd/builds/633803737utm_medium=notification&utm_source=github_status.

So this correct clippy error appeared in 1.40, and went away again in 1.41.

@mulkieran mulkieran changed the title Strange sort-of-regression in a single lint Strange sort-of-regression in a single lint: clippy::redundant-clone Jan 7, 2020
@mulkieran
Copy link
Author

I made up a new PR: stratis-storage/stratisd#1773 that has exactly the code that causes the problem.

bors added a commit that referenced this issue Jan 8, 2020
Fix redundant_clone lint not working with PathBuf and OsString

#4825 diabled MIR optimization in clippy, including `rustc_mir::transform::InstCombine` which reduces `&(*x)` to `x`. This PR tries to unwrap `&*` when looking into `mir::Rvalue`s.

Fixes #5014.

---

changelog: fixed `redundant_clone` lint not working with `PathBuf` and `OsString`
@bors bors closed this as completed in 52b9e70 Jan 8, 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

Successfully merging a pull request may close this issue.

1 participant