error[E0499]: cannot borrow `*f` as mutable more than once at a time --> $DIR/two-phase-nonrecv-autoref.rs:51:11 | LL | f(f(10)); | - ^ second mutable borrow occurs here | | | first mutable borrow occurs here | first borrow later used by call error[E0382]: use of moved value: `f` --> $DIR/two-phase-nonrecv-autoref.rs:59:11 | LL | fn twice_ten_so i32>(f: Box) { | - move occurs because `f` has type `Box`, which does not implement the `Copy` trait LL | f(f(10)); | - ^ value used here after move | | | value moved here error[E0499]: cannot borrow `*f` as mutable more than once at a time --> $DIR/two-phase-nonrecv-autoref.rs:65:11 | LL | f(f(10)); | - ^ second mutable borrow occurs here | | | first mutable borrow occurs here | first borrow later used by call error[E0382]: use of moved value: `f` --> $DIR/two-phase-nonrecv-autoref.rs:73:11 | LL | fn twice_ten_oo(f: Box i32>) { | - move occurs because `f` has type `Box i32>`, which does not implement the `Copy` trait LL | f(f(10)); | - ^ value used here after move | | | value moved here error[E0502]: cannot borrow `a` as immutable because it is also borrowed as mutable --> $DIR/two-phase-nonrecv-autoref.rs:112:27 | LL | double_access(&mut a, &a); | ------------- ------ ^^ immutable borrow occurs here | | | | | mutable borrow occurs here | mutable borrow later used by call error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable --> $DIR/two-phase-nonrecv-autoref.rs:138:7 | LL | i[i[3]] = 4; | --^---- | | | | | immutable borrow occurs here | mutable borrow occurs here | mutable borrow later used here error[E0502]: cannot borrow `i` as immutable because it is also borrowed as mutable --> $DIR/two-phase-nonrecv-autoref.rs:143:7 | LL | i[i[3]] = i[4]; | --^---- | | | | | immutable borrow occurs here | mutable borrow occurs here | mutable borrow later used here error: aborting due to 7 previous errors Some errors have detailed explanations: E0382, E0499, E0502. For more information about an error, try `rustc --explain E0382`.