You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It says: "cannot borrow immutable borrowed content as mutable".
Instead, I have to explicitly dereference and borrow the closure in the loop, with (&mut *closure)(val). Typically, Rust performs this automatically, so I expected that to also happen in this case. At the very least, the error message should be improved, as currently, it doesn't help with the actual issue at all.
The text was updated successfully, but these errors were encountered:
See issue rust-lang#27106.
The non-hacky version requires a substantial amount of refactoring.
Conceptually, though, this is straightforward: we just need to make
calls use the existing code to handle `&mut self` in
confirm::fixup_derefs_on_method_receiver_if_necessary.
The following code does not compile:
(Playpen)
It says: "cannot borrow immutable borrowed content as mutable".
Instead, I have to explicitly dereference and borrow the closure in the loop, with
(&mut *closure)(val)
. Typically, Rust performs this automatically, so I expected that to also happen in this case. At the very least, the error message should be improved, as currently, it doesn't help with the actual issue at all.The text was updated successfully, but these errors were encountered: