1 error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable
2 --> $DIR/borrowck-unboxed-closures.rs:3:5
5 | ------ mutable borrow occurs here
7 | ^ immutable borrow occurs here
9 | - mutable borrow later used here
11 error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable
12 --> $DIR/borrowck-unboxed-closures.rs:7:5
14 LL | fn b<F:FnMut(isize, isize) -> isize>(f: F) {
15 | - help: consider changing this to be mutable: `mut f`
17 | ^ cannot borrow as mutable
19 error[E0382]: use of moved value: `f`
20 --> $DIR/borrowck-unboxed-closures.rs:12:5
22 LL | fn c<F:FnOnce(isize, isize) -> isize>(f: F) {
23 | - move occurs because `f` has type `F`, which does not implement the `Copy` trait
25 | ------- `f` moved due to this call
27 | ^ value used here after move
29 note: this value implements `FnOnce`, which causes it to be moved when called
30 --> $DIR/borrowck-unboxed-closures.rs:11:5
34 help: consider further restricting this bound
36 LL | fn c<F:FnOnce(isize, isize) -> isize + Copy>(f: F) {
39 error: aborting due to 3 previous errors
41 Some errors have detailed explanations: E0382, E0502, E0596.
42 For more information about an error, try `rustc --explain E0382`.