Closed
Description
foo.rs:11:5: 11:6 error: moving out of mutable local variable prohibited due to outstanding loan
foo.rs:11 (a).bar();
^
foo.rs:11:5: 11:6 note: loan of mutable local variable granted here
foo.rs:11 (a).bar();
^
error: aborting due to previous error
The compiler seems to consider (a)
as an evaluation to a temporary value of the same type, which results in a quite confusing error. This doesn't occur with function((&mut x))
. @bstrie discovered this while removing mut fields.