]>
Commit | Line | Data |
---|---|---|
48663c56 | 1 | error[E0502]: cannot borrow `*collection` as mutable because it is also borrowed as immutable |
0731742a | 2 | --> $DIR/issue-42106.rs:3:5 |
abe05a73 | 3 | | |
0531ce1d | 4 | LL | let _a = &collection; |
48663c56 | 5 | | ----------- immutable borrow occurs here |
532ac7d7 | 6 | LL | collection.swap(1, 2); |
c295e0f8 | 7 | | ^^^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here |
94b46f34 | 8 | LL | _a.use_ref(); |
c295e0f8 | 9 | | ------------ immutable borrow later used here |
abe05a73 | 10 | |
2c00a5a8 | 11 | error: aborting due to previous error |
abe05a73 | 12 | |
0531ce1d | 13 | For more information about this error, try `rustc --explain E0502`. |