2017-10-29 22:58:45 +00:00
|
|
|
error[E0502]: cannot borrow `*collection` as mutable because `collection` is also borrowed as immutable
|
|
|
|
--> $DIR/issue-42106.rs:13:5
|
|
|
|
|
|
|
|
|
12 | let _a = &collection;
|
|
|
|
| ---------- immutable borrow occurs here
|
2017-11-20 12:13:27 +00:00
|
|
|
13 | collection.swap(1, 2); //~ ERROR also borrowed as immutable
|
2017-10-29 22:58:45 +00:00
|
|
|
| ^^^^^^^^^^ mutable borrow occurs here
|
|
|
|
14 | }
|
|
|
|
| - immutable borrow ends here
|
|
|
|
|
2018-01-02 19:00:12 +00:00
|
|
|
error: aborting due to previous error
|
2017-10-29 22:58:45 +00:00
|
|
|
|
2018-02-19 20:40:25 +00:00
|
|
|
If you want more information on this error, try using "rustc --explain E0502"
|