Fix iter_kv_map false positive into_keys and into_values suggestion by matthri ·...
source link: https://github.com/rust-lang/rust-clippy/pull/11757
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
Conversation
Contributor
fixes: #11752
changelog: [iter_kv_map
]: fix false positive: Don't suggest into_keys()
and into_values()
if the MSRV is to low
Collaborator
r? @Alexendoo (rustbot has picked a reviewer for you, use r? to override) |
added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label
Contributor
Author
Thanks for pointing that out, I updated the documentation |
Contributor
☔ The latest upstream changes (presumably #11750) made this pull request unmergeable. Please resolve the merge conflicts. |
Changes look good to me 👍
I have one comment but that's not really concerned with the PR here, rather the lint itself, so feel free to ignore.
) { |
||
if map_type == "into_iter" && !msrv.meets(msrvs::INTO_KEYS) { |
||
return; |
||
} |
||
if !expr.span.from_expansion() |
||
&& let ExprKind::Closure(c) = m_arg.kind |
Contributor
This lint should probably check that the closure doesn't have parameter- or return type annotations since that can help type inference or make the map
closure act as a coercion site.
Not your problem though, that could be a PR on its own, unless you also want to try to fix that here ^^.
Examples where the machine applicable suggestion breaks: coercions, inference
Contributor
Author
I will have a try fixing this, but I think I will open a separate PR so this one doesn't get too cluttered ^^
Member
Thanks! @bors r+ |
Contributor
💔 Test failed - checks-action_test |
Contributor
Author
I ran the |
Member
Yeah a note would be good, would be good for us to see if we can make it automatic also |
Member
@bors r+ |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
No milestone
Successfully merging this pull request may close these issues.
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK