-
Notifications
You must be signed in to change notification settings - Fork 1.5k
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
manual_inspect
suggestion breaks mutating code
#13185
Comments
@rustbot claim |
Hit this exact issue (a d the other linked issue) in this code |
Same. Hit the same issue with this code. Had to suppress the warning for now but I don't think it's a case of manual |
This is still an issue, and this clippy is now stabilized and enabled by default on the latest stable release. |
I still have the will to work on this issue, but I've been busy with work for a while, so I don't think I'll be able to do it this month. If there is someone who is interested, it would be nice if that person could be in charge. |
@rustbot claim |
Summary
Here is a playground link: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=e4fad507e221cf2e8540575031233165
The suggestion leads to broken code which does not compile:
Using
inspect
, I end up with& &mut A
, and I can’t seem to be able to mutate things through that reference.Changing the signature as suggested in the second compiler error is also not possible.
Lint Name
manual_inspect
Reproducer
I tried this code:
I saw this happen:
Version
Additional Labels
No response
The text was updated successfully, but these errors were encountered: