]> git.lizzy.rs Git - rust.git/blob - tests/ui/moves/moves-based-on-type-no-recursive-stack-closure.stderr
Rollup merge of #106446 - bzEq:fix-unwind-lsda, r=Amanieu
[rust.git] / tests / ui / moves / moves-based-on-type-no-recursive-stack-closure.stderr
1 error[E0499]: cannot borrow `*f` as mutable more than once at a time
2   --> $DIR/moves-based-on-type-no-recursive-stack-closure.rs:20:27
3    |
4 LL |                     (f.c)(f, true);
5    |                     ----- ^ second mutable borrow occurs here
6    |                     |
7    |                     first mutable borrow occurs here
8    |                     first borrow later used by call
9
10 error[E0382]: borrow of moved value: `f`
11   --> $DIR/moves-based-on-type-no-recursive-stack-closure.rs:32:5
12    |
13 LL | fn conspirator<F>(mut f: F) where F: FnMut(&mut R, bool) {
14    |                   ----- move occurs because `f` has type `F`, which does not implement the `Copy` trait
15 LL |     let mut r = R {c: Box::new(f)};
16    |                                - value moved here
17 LL |     f(&mut r, false)
18    |     ^ value borrowed here after move
19    |
20 help: consider mutably borrowing `f`
21    |
22 LL |     let mut r = R {c: Box::new(&mut f)};
23    |                                ++++
24
25 error: aborting due to 2 previous errors
26
27 Some errors have detailed explanations: E0382, E0499.
28 For more information about an error, try `rustc --explain E0382`.