fork/rust

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

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

master
849 B21 linesraw
1error[E0382]: borrow of moved value: `state`
2  --> $DIR/reborrow-sugg-move-then-borrow.rs:20:18
3   |
4LL | fn fill_memory_blocks_mt(state: &mut State) {
5   |                          ----- move occurs because `state` has type `&mut State`, which does not implement the `Copy` trait
6LL |     for _ in state {}
7   |              ----- `state` moved due to this implicit call to `.into_iter()`
8LL |
9LL |     fill_segment(state);
10   |                  ^^^^^ value borrowed here after move
11   |
12note: `into_iter` takes ownership of the receiver `self`, which moves `state`
13  --> $SRC_DIR/core/src/iter/traits/collect.rs:LL:COL
14help: consider creating a fresh reborrow of `state` here
15   |
16LL |     for _ in &mut *state {}
17   |              ++++++
18
19error: aborting due to previous error
20
21For more information about this error, try `rustc --explain E0382`.