1 error[E0499]: cannot borrow `f` as mutable more than once at a time
2 --> $DIR/borrowck-call-is-borrow-issue-12224.rs:12:16
5 | - ^^ second mutable borrow occurs here
7 | first mutable borrow occurs here
9 LL | f((Box::new(|| {})))
10 | - borrow occurs due to use of `f` in closure
12 | - first borrow ends here
14 error[E0596]: cannot borrow immutable borrowed content `*f` as mutable
15 --> $DIR/borrowck-call-is-borrow-issue-12224.rs:25:5
17 LL | fn test2<F>(f: &F) where F: FnMut() {
18 | -- use `&mut F` here to make mutable
20 | ^^^^ cannot borrow as mutable
22 error[E0596]: cannot borrow field `f.f` of immutable binding as mutable
23 --> $DIR/borrowck-call-is-borrow-issue-12224.rs:34:5
25 LL | fn test4(f: &Test) {
26 | ----- use `&mut Test` here to make mutable
28 | ^^^ cannot mutably borrow field of immutable binding
30 error[E0504]: cannot move `f` into closure because it is borrowed
31 --> $DIR/borrowck-call-is-borrow-issue-12224.rs:56:13
34 | - borrow of `f` occurs here
36 | ^ move into closure occurs here
38 error[E0507]: cannot move out of captured outer variable in an `FnMut` closure
39 --> $DIR/borrowck-call-is-borrow-issue-12224.rs:56:13
41 LL | let mut f = move |g: Box<FnMut(isize)>, b: isize| {
42 | ----- captured outer variable
45 | ^ cannot move out of captured outer variable in an `FnMut` closure
47 error: aborting due to 5 previous errors
49 Some errors have detailed explanations: E0499, E0504, E0507, E0596.
50 For more information about an error, try `rustc --explain E0499`.