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

Fix manual_map false positives #6801

Merged
merged 4 commits into from
Mar 2, 2021
Merged

Conversation

Jarcho
Copy link
Contributor

@Jarcho Jarcho commented Feb 26, 2021

fixes: #6795
fixes: #6797
fixes: #6811
fixes: #6819

changelog: Fix false positives for manual_map when return, break, continue, yield, await, and partially moved values are used.
changelog: Don't expand macros in suggestions for manual_map

@rust-highfive
Copy link

r? @phansch

(rust-highfive has picked a reviewer for you, use r? to override)

@rust-highfive rust-highfive added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Feb 26, 2021
@Jarcho Jarcho changed the title Fix manual_map fals positives Fix manual_map false positives Feb 26, 2021
@camsteffen
Copy link
Contributor

Should probably also revert #6796

@matthiaskrgr
Copy link
Member

There is also a bug where macros are expanded in the suggestion (for example, if you map like this: Some(x) => Some(vec![x])
See #6811

You might be able to fix this by using snippet_with_macro_callsite instead of snippet somewhere like I did here:

5d48b91#diff-91a6b641836ec4d791eef672694e2e955b77f9b9e287fcbaacbdb83b3734acabL190

@phansch
Copy link
Member

phansch commented Mar 2, 2021

@bors r+ thanks!

@bors
Copy link
Collaborator

bors commented Mar 2, 2021

📌 Commit 2c485e3 has been approved by phansch

@bors
Copy link
Collaborator

bors commented Mar 2, 2021

⌛ Testing commit 2c485e3 with merge ece3543...

@bors
Copy link
Collaborator

bors commented Mar 2, 2021

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: phansch
Pushing ece3543 to master...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
S-waiting-on-review Status: Awaiting review from the assignee but also interested parties
Projects
None yet
6 participants