fork/rust
git clone https://git.julia.blue/fork/rust
8d69840ab92
1.43.1
1error[E0502]: cannot borrow `f` as immutable because it is also borrowed as mutable 2 --> $DIR/borrowck-unboxed-closures.rs:3:5 3 | 4LL | let g = &mut f; 5 | ------ mutable borrow occurs here 6LL | f(1, 2); 7 | ^ immutable borrow occurs here 8LL | use_mut(g); 9 | - mutable borrow later used here 10 11error[E0596]: cannot borrow `f` as mutable, as it is not declared as mutable 12 --> $DIR/borrowck-unboxed-closures.rs:7:5 13 | 14LL | fn b<F:FnMut(isize, isize) -> isize>(f: F) { 15 | - help: consider changing this to be mutable: `mut f` 16LL | f(1, 2); 17 | ^ cannot borrow as mutable 18 19error[E0382]: use of moved value: `f` 20 --> $DIR/borrowck-unboxed-closures.rs:12:5 21 | 22LL | fn c<F:FnOnce(isize, isize) -> isize>(f: F) { 23 | - move occurs because `f` has type `F`, which does not implement the `Copy` trait 24LL | f(1, 2); 25 | - value moved here 26LL | f(1, 2); 27 | ^ value used here after move 28 | 29help: consider further restricting this bound with `+ Copy` 30 --> $DIR/borrowck-unboxed-closures.rs:10:8 31 | 32LL | fn c<F:FnOnce(isize, isize) -> isize>(f: F) { 33 | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ 34 35error: aborting due to 3 previous errors 36 37Some errors have detailed explanations: E0382, E0502, E0596. 38For more information about an error, try `rustc --explain E0382`.