-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
use_self lint suggests changing code to use outer type parameters breaking build #3859
Labels
C-bug
Category: Clippy is not doing the correct thing
good-first-issue
These issues are a good way to get started with Clippy
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
L-suggestion
Lint: Improving, adding or fixing lint suggestions
Comments
flip1995
added
C-bug
Category: Clippy is not doing the correct thing
good-first-issue
These issues are a good way to get started with Clippy
L-suggestion
Lint: Improving, adding or fixing lint suggestions
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
labels
Mar 8, 2019
The same as #2843 but it's better documented. |
This happens due to this rust-lang/rust issue: rust-lang/rust#64247 |
tnielens
added a commit
to tnielens/rust-clippy
that referenced
this issue
Apr 26, 2020
tnielens
added a commit
to tnielens/rust-clippy
that referenced
this issue
Apr 26, 2020
tnielens
added a commit
to tnielens/rust-clippy
that referenced
this issue
Apr 26, 2020
tnielens
added a commit
to tnielens/rust-clippy
that referenced
this issue
Apr 27, 2020
flip1995
pushed a commit
to flip1995/rust-clippy
that referenced
this issue
Apr 29, 2020
bors
added a commit
that referenced
this issue
Oct 13, 2020
…itive, r=<try> rework use_self impl based on ty::Ty comparison #3410 `use_self` lint refactoring. As suggested by `@eddyb` , implement the lint based on `ty::Ty` comparison instead of `hir::Path` checks. This PR introduces negative regressions. The cases were covered in the previous implementation. See the test file. It fixes #3410, #2843, #3859, #4734 and #4140. Should fix #4143 (example doesn't compile). #4305 false positive seems also fixed but the uitest fails to compile the unmodified test case in `use_self.rs.fixed`. Implements #5078. Generally the implementation checks are done at mir level and offers higher guarantees against false positives. It is probably fixing other unreported false positives. changelog: fix use_self generics false positives
bors
added a commit
that referenced
this issue
Jan 19, 2021
Rework use_self impl based on ty::Ty comparison #3410 | Take 2 This builds on top of #5531 I already reviewed and approved the commits by `@montrivo.` So only the review of my commits should be necessary. I would also appreciate your review `@montrivo,` since you are familiar with the challenges here. Fixes #3410 and Fixes #4143 (same problem) Fixes #2843 Fixes #3859 Fixes #4734 and fixes #6221 Fixes #4305 Fixes #5078 (even at expression level now 🎉) Fixes #3881 and Fixes #4887 (same problem) Fixes #3909 Not yet: #4140 (test added) All the credit for the fixes goes to `@montrivo.` I only refactored and copy and pasted his code. changelog: rewrite [`use_self`] lint and fix multiple (8) FPs. One to go.
For reasons I'm not entirely certain of, I can't even silence this lint on a |
bors
added a commit
that referenced
this issue
Feb 10, 2021
Rework use_self impl based on ty::Ty comparison #3410 | Take 2 This builds on top of #5531 I already reviewed and approved the commits by `@montrivo.` So only the review of my commits should be necessary. I would also appreciate your review `@montrivo,` since you are familiar with the challenges here. Fixes #3410 and Fixes #4143 (same problem) Fixes #2843 Fixes #3859 Fixes #4734 and fixes #6221 Fixes #4305 Fixes #5078 (even at expression level now 🎉) Fixes #3881 and Fixes #4887 (same problem) Fixes #3909 Not yet: #4140 (test added) All the credit for the fixes goes to `@montrivo.` I only refactored and copy and pasted his code. changelog: rewrite [`use_self`] lint and fix multiple (8) FPs. One to go.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
C-bug
Category: Clippy is not doing the correct thing
good-first-issue
These issues are a good way to get started with Clippy
I-suggestion-causes-error
Issue: The suggestions provided by this Lint cause an ICE/error when applied
L-suggestion
Lint: Improving, adding or fixing lint suggestions
Here (playground):
this example compiles, but clippy errors with
Applying the proposed fix results in a compilation error:
The text was updated successfully, but these errors were encountered: