inline clippy_utils::ptr
into needless_pass_by_value
#15760
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
While looking into #15569, I stumbled upon
clippy_utils::ptr
.This module was created in #2117, to share the logic from
ptr_arg
withneedless_pass_by_value
. But then later, #8409 removed the use of the logic fromptr_arg
, which leftneedless_pass_by_value
as the only user of this module.Still, I wanted to try to add docs to the module, but the two functions looked all too specific, so I thought it'd be better to just move them to
needless_pass_by_value
, in the hopes that whoever is looking at that lint will hopefully have enough context to understand what those functions are doing.changelog: none