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
The issue is specific to Trait objects. Changing player: &mut Character to a player: &mut Mummy works.
Moreover, there is a different issue, in that this problem is also solved by changing player: &mut Character to mut player: &mut Character which should not be necessary, as I do not reassign the player reference/pointer.
// Compiler output
traitfail.rs:30:13: 30:18 error: cannot borrow immutable local variable as mutable
traitfail.rs:30 let x_mut = slide.x_mut();
^~~~~
error: aborting due to previous error
The text was updated successfully, but these errors were encountered:
For a simple sample check this file: https://gist.github.com/MarkJr94/5888147
This is the Character trait:
The issue is specific to Trait objects. Changing
player: &mut Character
to aplayer: &mut Mummy
works.Moreover, there is a different issue, in that this problem is also solved by changing
player: &mut Character
tomut player: &mut Character
which should not be necessary, as I do not reassign the player reference/pointer.Minimal Example:
The text was updated successfully, but these errors were encountered: