-
Notifications
You must be signed in to change notification settings - Fork 13.4k
Compiler should hint to user to deref when doing reference assignment #33570
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Comments
In the general case (i.e. for arbitrary opt = &mut expr; or if it was *opt = expr; ? I would be a little cautious about unilaterally suggesting the latter when the former is potentially what was desired...
(However, when Update: of course in many cases suggesting |
@pnkfelix if |
The compiler now suggests:
The suggestion is not smart enough to also suggest |
Update:
Compiler still not smart enough to suggest |
…avis Suggest dereferencing on assignment to mutable borrow Fix rust-lang#33570
Uh oh!
There was an error while loading. Please reload this page.
https://is.gd/wm0S9G
It'd be great if this had a hint:
Someone on IRC just ran into this.
The text was updated successfully, but these errors were encountered: