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

Note calls to other functions that need the ref instead of a slice #2137

Closed
wants to merge 1 commit into from

Conversation

llogiq
Copy link
Contributor

@llogiq llogiq commented Oct 14, 2017

This also applies to the needless_pass_by_value lint, though I haven't taken the time to figure out how to test it. Apart from that it will only note the calls/method calls, not the called functions/methods. Perhaps we should be able to avoid linting if the called functions are in external crates.

I'll leave both of those weaknesses to followup PRs.

This also applies to the needless_pass_by_value lint, though I haven't taken
the time to figure out how to test it. Apart from that it will only note the
calls/method calls, not the called functions/methods. Perhaps we should be
able to avoid linting if the called functions are in external crates.

I'll leave both of those weaknesses to followup PRs.
@oli-obk
Copy link
Contributor

oli-obk commented Oct 15, 2017

Should we do this at all? I mean your example test is a false positive imo. Do you have a real use case that is not already covered by the repeated application of the other lints?

@llogiq
Copy link
Contributor Author

llogiq commented Oct 15, 2017

I think noting it is a net win, because if someone changes the caller, but fails to change the caller, they will get a compile error. If they then complain, we can point them to the note. Also, we can extend this to omit linting if the caller is external to this crate.

@oli-obk oli-obk added the S-needs-discussion Status: Needs further discussion before merging or work can be started label Oct 16, 2017
@oli-obk
Copy link
Contributor

oli-obk commented Oct 26, 2017

I think we should just not lint sub_function. If the other functions are changed, it'll start linting anyway with the existing lints.

@llogiq
Copy link
Contributor Author

llogiq commented Sep 27, 2019

I think it's safe to close this, as I no longer know what it should have done.

@llogiq llogiq closed this Sep 27, 2019
@flip1995 flip1995 mentioned this pull request Oct 28, 2019
@llogiq llogiq deleted the ptr_arg_calls branch October 17, 2020 19:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-needs-discussion Status: Needs further discussion before merging or work can be started
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants