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