fork/rust

git clone https://git.julia.blue/fork/rust

borsAuto merge of #103046 - JanBeh:PR_clarify_cmp_terminology, r=workingjubilee3bcad65fbf6

master
931 B22 linesraw
1error[E0502]: cannot borrow `v` as mutable because it is also borrowed as immutable
2  --> $DIR/issue-82462.rs:18:9
3   |
4LL |     for x in DroppingSlice(&*v).iter() {
5   |              ------------------
6   |              |               |
7   |              |               immutable borrow occurs here
8   |              a temporary with access to the immutable borrow is created here ...
9LL |         v.push(*x);
10   |         ^^^^^^^^^^ mutable borrow occurs here
11LL |         break;
12LL |     }
13   |     - ... and the immutable borrow might be used here, when that temporary is dropped and runs the `Drop` code for type `DroppingSlice`
14   |
15help: consider adding semicolon after the expression so its temporaries are dropped sooner, before the local variables declared by the block are dropped
16   |
17LL |     };
18   |      +
19
20error: aborting due to previous error
21
22For more information about this error, try `rustc --explain E0502`.