1 error[E0503]: cannot use `arr` because it was mutably borrowed
2 --> $DIR/arrays.rs:14:5
5 | -- `arr` is borrowed here
7 | --- borrow occurs due to use of `arr` in closure
10 | ^^^^^^ use of borrowed `arr`
13 | - borrow later used here
15 error[E0503]: cannot use `arr[_]` because it was mutably borrowed
16 --> $DIR/arrays.rs:14:5
19 | -- `arr` is borrowed here
21 | --- borrow occurs due to use of `arr` in closure
24 | ^^^^^^^^^^^^ use of borrowed `arr`
27 | - borrow later used here
29 error[E0506]: cannot assign to `arr[_]` because it is borrowed
30 --> $DIR/arrays.rs:29:5
33 | -- `arr[_]` is borrowed here
34 LL | println!("{:#?}", &arr[3..4]);
35 | --- borrow occurs due to use in closure
38 | ^^^^^^^^^^^^ `arr[_]` is assigned to here but it was already borrowed
41 | - borrow later used here
43 error[E0506]: cannot assign to `arr[_]` because it is borrowed
44 --> $DIR/arrays.rs:43:5
47 | -- `arr[_]` is borrowed here
48 LL | println!("{}", arr[3]);
49 | --- borrow occurs due to use in closure
52 | ^^^^^^^^^^^^ `arr[_]` is assigned to here but it was already borrowed
55 | - borrow later used here
57 error[E0503]: cannot use `arr` because it was mutably borrowed
58 --> $DIR/arrays.rs:57:20
61 | -- `arr` is borrowed here
63 | --- borrow occurs due to use of `arr` in closure
65 LL | println!("{}", arr[3]);
66 | ^^^^^^ use of borrowed `arr`
69 | - borrow later used here
71 error[E0502]: cannot borrow `arr[_]` as immutable because it is also borrowed as mutable
72 --> $DIR/arrays.rs:57:20
75 | -- mutable borrow occurs here
77 | --- first borrow occurs due to use of `arr` in closure
79 LL | println!("{}", arr[3]);
80 | ^^^^^^ immutable borrow occurs here
83 | - mutable borrow later used here
85 = note: this error originates in the macro `$crate::format_args_nl` which comes from the expansion of the macro `println` (in Nightly builds, run with -Z macro-backtrace for more info)
87 error[E0502]: cannot borrow `arr` as immutable because it is also borrowed as mutable
88 --> $DIR/arrays.rs:73:24
91 | -- mutable borrow occurs here
93 | --- first borrow occurs due to use of `arr` in closure
95 LL | println!("{:#?}", &arr[3..2]);
96 | ^^^ immutable borrow occurs here
99 | - mutable borrow later used here
101 error: aborting due to 7 previous errors
103 Some errors have detailed explanations: E0502, E0503, E0506.
104 For more information about an error, try `rustc --explain E0502`.