-
Notifications
You must be signed in to change notification settings - Fork 13k
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
Compiler should hint to user to deref when doing reference assignment #33570
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
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: