Skip to content

ptr_arg false positives #2293

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

Closed
clarfonthey opened this issue Dec 23, 2017 · 2 comments
Closed

ptr_arg false positives #2293

clarfonthey opened this issue Dec 23, 2017 · 2 comments
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

Comments

@clarfonthey
Copy link

Currently, impls on String and Vec will fire this lint, especially the ones in the standard library. This shouldn't fire if the methods are for &self, just when the type is used explicitly.

@oli-obk
Copy link
Contributor

oli-obk commented Dec 24, 2017

I'm assuming this will also trigger on impl Foo for String { fn bar(&self) {} }

needs a check whether the argument is the first argument of a method with self style (the latter part needs to be checked in the FnSig I think)

@oli-obk oli-obk added the good first issue These issues are a good way to get started with Clippy label Dec 24, 2017
@phansch phansch added the C-bug Category: Clippy is not doing the correct thing label Apr 12, 2018
@JoshMcguigan
Copy link
Contributor

@oli-obk I created a PR (#3131) after adding to the ptr_arg test file like you've described. I expected at that point to get a test failure, because the expectation was that this lint would fire (incorrectly) which wouldn't match the existing ptr_arg.stderr. But after adding the test case the tests still pass.

Can you provide additional guidance here? I am new to the clippy codebase and just want to make sure I'm not missing something.

Thanks!

@oli-obk oli-obk closed this as completed in ebb88a4 Sep 5, 2018
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
Projects
None yet
Development

No branches or pull requests

4 participants