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

collection_is_never_read: Handle unit type #10492

Merged
merged 3 commits into from
Apr 11, 2023

Conversation

schubart
Copy link
Contributor

changelog: [collection_is_never_read]: Fix false negative
fixes: #10488

@rustbot
Copy link
Collaborator

rustbot commented Mar 12, 2023

r? @Manishearth

(rustbot has picked a reviewer for you, use r? to override)

@rustbot rustbot added the S-waiting-on-review Status: Awaiting review from the assignee but also interested parties label Mar 12, 2023
@llogiq
Copy link
Contributor

llogiq commented Mar 13, 2023

What about methods that use &mutably borrowed arguments to get the read values back to the caller?

@schubart
Copy link
Contributor Author

schubart commented Mar 13, 2023

Are there methods like that in the collection classes? (Ignoring methods from extension traits, we already excluded those in the original PR.)

I could inspect the argument types of a method and look for &mut ones, but I'd prefer to do that in a separate PR since it would be fixing a potential false positive, while this one here fixes a false negative.

@schubart schubart marked this pull request as ready for review March 19, 2023 08:36
@Manishearth
Copy link
Member

r=me, though there are conflicts

(sorry about missing this PR)

@bors
Copy link
Contributor

bors commented Apr 11, 2023

☔ The latest upstream changes (presumably #10614) made this pull request unmergeable. Please resolve the merge conflicts.

@schubart schubart force-pushed the collection_is_never_read_unit_type branch from ead06fc to 3d71145 Compare April 11, 2023 01:38
@schubart
Copy link
Contributor Author

Thanks, merge conflicts fixed.

@Manishearth
Copy link
Member

@bors r+

@bors
Copy link
Contributor

bors commented Apr 11, 2023

📌 Commit 3d71145 has been approved by Manishearth

It is now in the queue for this repository.

@bors
Copy link
Contributor

bors commented Apr 11, 2023

⌛ Testing commit 3d71145 with merge 3b5b2ed...

@bors
Copy link
Contributor

bors commented Apr 11, 2023

☀️ Test successful - checks-action_dev_test, checks-action_remark_test, checks-action_test
Approved by: Manishearth
Pushing 3b5b2ed to master...

@bors bors merged commit 3b5b2ed into rust-lang:master Apr 11, 2023
@schubart schubart deleted the collection_is_never_read_unit_type branch April 11, 2023 03:21
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
Development

Successfully merging this pull request may close these issues.

FN collection_is_never_read: grabbing unit value of push()
5 participants