error[E0506]: cannot assign to `*y.pointer` because it is borrowed --> $DIR/borrowck-assign-to-andmut-in-borrowed-loc.rs:28:9 | LL | let z = copy_borrowed_ptr(&mut y); | - borrow of `*y.pointer` occurs here LL | *y.pointer += 1; //~ ERROR cannot assign | ^^^^^^^^^^^^^^^ assignment to borrowed `*y.pointer` occurs here error: aborting due to previous error For more information about this error, try `rustc --explain E0506`.