5

Fix iter_kv_map false positive into_keys and into_values suggestion by matthri ·...

 9 months ago
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.
neoserver,ios ssh client

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)

rustbot

added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label

Nov 3, 2023

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.

Contributor

@y21 y21

left a comment

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 ^^

y21 reacted with thumbs up emoji

Member

Thanks! @bors r+

Contributor

📌 Commit d77b9be has been approved by Alexendoo

It is now in the queue for this repository.

Contributor

⌛ Testing commit d77b9be with merge ac92899...

Contributor

💔 Test failed - checks-action_test

Contributor

Author

I ran the cargo collect-metadata command to update book/src/lint_configuration.md.
Should this maybe get mentioned in the documentation?

Member

Yeah a note would be good, would be good for us to see if we can make it automatic also

Member

@bors r+

Contributor

📌 Commit a20f61b has been approved by Alexendoo

It is now in the queue for this repository.

Contributor

⌛ Testing commit a20f61b with merge c24784e...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

Back to tour

y21

y21 approved these changes

Alexendoo

Awaiting requested review from Alexendoo
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

iter_kv_map needs to be MSRV gated on 1.54

5 participants

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK