rust/src/test/ui/borrowck/borrowck-assign-to-andmut-in-borrowed-loc.stderr

12 lines
501 B
Plaintext
Raw Normal View History

2018-08-08 12:28:26 +00:00
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`.