fork/rust

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

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

master
1.0 KiB25 linesraw
1error[E0382]: use of moved value: `value`
2  --> $DIR/mut-borrow-in-loop-2.rs:31:23
3   |
4LL | fn this_does_not<'a, R>(value: &'a mut Events<R>) {
5   |                         ----- move occurs because `value` has type `&mut Events<R>`, which does not implement the `Copy` trait
6LL |     for _ in 0..3 {
7   |     ------------- inside of this loop
8LL |         Other::handle(value);
9   |                       ^^^^^ value moved here, in previous iteration of loop
10   |
11note: consider changing this parameter type in function `handle` to borrow instead if owning the value isn't necessary
12  --> $DIR/mut-borrow-in-loop-2.rs:9:22
13   |
14LL |     fn handle(value: T) -> Self;
15   |        ------        ^ this parameter takes ownership of the value
16   |        |
17   |        in this function
18help: consider creating a fresh reborrow of `value` here
19   |
20LL |         Other::handle(&mut *value);
21   |                       ++++++
22
23error: aborting due to previous error
24
25For more information about this error, try `rustc --explain E0382`.