-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
needless_pass_by_ref_mut
false positive in closure in async
#11380
Comments
@GuillaumeGomez, would this be important to fix before the lint lands in stable? I am not sure about the release process, but it sounded to me like it would be relevant for beta: #11314 (comment) |
It'd be better indeed. I started looking at it but I'm a bit under the water currently, too many "more pressing" things to do. Hopefully I should be able to get back to it this week-end or next week. |
Caught this in real-world code yesterday: (Not a showstopper, just thought I'd add a data point!) |
I really need to find time to fix this... |
@GuillaumeGomez is this a good first issue? Is there a place one could get guidance to fix this? |
Honestly I don't think it's a good first issue at all. You can see the code here. If you want to start contributing on clippy, I'll be more than happy to help getting started but in this case, the problem is that the code generated by rustc for async is quite tricky to handle, especially variables being passed through which change IDs etc. Lots of fun. :3 |
I opened #11492 which fixes this issue. |
Summary
Another variant of #11179 and #11299.
Found here: hermit-os/kernel/src/fd/socket/tcp.rs#L69-L94
Lint Name
needless_pass_by_ref_mut
Reproducer
I tried this code:
I saw this happen:
I expected to see this happen:
No
needless_pass_by_ref_mut
.Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: