1 error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable
2 --> $DIR/borrowck-assign-comp-idx.rs:12:5
4 LL | let q: &isize = &p[0];
5 | - immutable borrow occurs here
8 | ^ mutable borrow occurs here
10 LL | println!("{}", *q);
11 | -- immutable borrow later used here
13 error[E0502]: cannot borrow `p` as mutable because it is also borrowed as immutable
14 --> $DIR/borrowck-assign-comp-idx.rs:27:9
17 | ------ immutable borrow later used by call
19 | -- immutable borrow occurs here
21 | ^^ - second borrow occurs due to use of `p` in closure
23 | mutable borrow occurs here
25 error: aborting due to 2 previous errors
27 For more information about this error, try `rustc --explain E0502`.