Open ChrisJefferson opened 3 years ago
Several members of my team (myself included) ran into this and I wrote up this very similar example before finding this bug: https://play.rust-lang.org/?version=nightly&mode=debug&edition=2021&gist=881fa5892e94d0722bb879221578cf64
It would be super awesome if the compiler could suggest a solution like
let mut guard = locked_point.lock().unwrap();
let point = &mut *guard;
Triage: no change.
Given the following code: https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=f3f0df13f266b9a222fbeedc4a8f6168
The current output is:
Ideally the output should tell the user that
g.
is not a simple "member access", which is why they can't borrow multiple members. It could even, in principle, tell them to capture*g
first, then access it'sa
andb
members, but I suspect that isn't simple (or even legal) in general.