]> git.lizzy.rs Git - rust.git/blob - tests/ui/borrowck/mut-borrow-in-loop-2.stderr
Move /src/test to /tests
[rust.git] / tests / ui / borrowck / mut-borrow-in-loop-2.stderr
1 error[E0382]: use of moved value: `value`
2   --> $DIR/mut-borrow-in-loop-2.rs:31:23
3    |
4 LL | 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
6 LL |     for _ in 0..3 {
7    |     ------------- inside of this loop
8 LL |         Other::handle(value);
9    |                       ^^^^^ value moved here, in previous iteration of loop
10    |
11 note: 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    |
14 LL |     fn handle(value: T) -> Self;
15    |        ------        ^ this parameter takes ownership of the value
16    |        |
17    |        in this function
18 help: consider creating a fresh reborrow of `value` here
19    |
20 LL |         Other::handle(&mut *value);
21    |                       ++++++
22
23 error: aborting due to previous error
24
25 For more information about this error, try `rustc --explain E0382`.