]> git.lizzy.rs Git - rust.git/blob - src/test/ui/borrowck/borrowck-unboxed-closures.stderr
Rollup merge of #59328 - koalatux:iter-nth-back, r=scottmcm
[rust.git] / src / test / ui / borrowck / borrowck-unboxed-closures.stderr
1 error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
2   --> $DIR/borrowck-unboxed-closures.rs:3:5
3    |
4 LL |     let g = &mut f;
5    |                  - mutable borrow occurs here
6 LL |     f(1, 2);
7    |     ^ immutable borrow occurs here
8 LL |     use_mut(g);
9 LL | }
10    | - mutable borrow ends here
11
12 error[E0596]: cannot borrow immutable argument `f` as mutable
13   --> $DIR/borrowck-unboxed-closures.rs:7:5
14    |
15 LL | fn b<F:FnMut(isize, isize) -> isize>(f: F) {
16    |                                      - help: make this binding mutable: `mut f`
17 LL |     f(1, 2);
18    |     ^ cannot borrow mutably
19
20 error[E0382]: use of moved value: `f`
21   --> $DIR/borrowck-unboxed-closures.rs:12:5
22    |
23 LL |     f(1, 2);
24    |     - value moved here
25 LL |     f(1, 2);
26    |     ^ value used here after move
27    |
28    = note: move occurs because `f` has type `F`, which does not implement the `Copy` trait
29
30 error: aborting due to 3 previous errors
31
32 Some errors occurred: E0382, E0502, E0596.
33 For more information about an error, try `rustc --explain E0382`.