1 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
2 --> $DIR/borrowck-slice-pattern-element-loan.rs:18:20
4 LL | if let [ref first, ref second, ..] = *s {
5 | ---------- immutable borrow occurs here
6 LL | if let [_, ref mut second2, ref mut third, ..] = *s {
7 | ^^^^^^^^^^^^^^^^ mutable borrow occurs here
8 LL | nop(&[first, second, second2, third]);
9 | ------ immutable borrow later used here
11 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
12 --> $DIR/borrowck-slice-pattern-element-loan.rs:34:21
14 LL | if let [.., ref fourth, ref third, _, ref first] = *s {
15 | --------- immutable borrow occurs here
16 LL | if let [.., ref mut third2, _, _] = *s {
17 | ^^^^^^^^^^^^^^ mutable borrow occurs here
18 LL | nop(&[first, third, third2, fourth]);
19 | ----- immutable borrow later used here
21 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
22 --> $DIR/borrowck-slice-pattern-element-loan.rs:45:20
24 LL | if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
25 | ------------- immutable borrow occurs here
27 LL | if let [_, ref mut from_begin1, ..] = *s {
28 | ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
29 LL | nop(&[from_begin1, from_end1, from_end3, from_end4]);
30 | --------- immutable borrow later used here
32 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
33 --> $DIR/borrowck-slice-pattern-element-loan.rs:48:23
35 LL | if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
36 | ------------- immutable borrow occurs here
38 LL | if let [_, _, ref mut from_begin2, ..] = *s {
39 | ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
40 LL | nop(&[from_begin2, from_end1, from_end3, from_end4]);
41 | --------- immutable borrow later used here
43 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
44 --> $DIR/borrowck-slice-pattern-element-loan.rs:51:26
46 LL | if let [.., _, ref from_end4, ref from_end3, _, ref from_end1] = *s {
47 | ------------- immutable borrow occurs here
49 LL | if let [_, _, _, ref mut from_begin3, ..] = *s {
50 | ^^^^^^^^^^^^^^^^^^^ mutable borrow occurs here
51 LL | nop(&[from_begin3, from_end1, from_end3, from_end4]);
52 | --------- immutable borrow later used here
54 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
55 --> $DIR/borrowck-slice-pattern-element-loan.rs:59:21
57 LL | if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s {
58 | --------------- immutable borrow occurs here
60 LL | if let [.., ref mut from_end2, _] = *s {
61 | ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
62 LL | nop(&[from_begin0, from_begin1, from_begin3, from_end2]);
63 | ----------- immutable borrow later used here
65 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
66 --> $DIR/borrowck-slice-pattern-element-loan.rs:62:21
68 LL | if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s {
69 | --------------- immutable borrow occurs here
71 LL | if let [.., ref mut from_end3, _, _] = *s {
72 | ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
73 LL | nop(&[from_begin0, from_begin1, from_begin3, from_end3]);
74 | ----------- immutable borrow later used here
76 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
77 --> $DIR/borrowck-slice-pattern-element-loan.rs:65:21
79 LL | if let [ref from_begin0, ref from_begin1, _, ref from_begin3, _, ..] = *s {
80 | --------------- immutable borrow occurs here
82 LL | if let [.., ref mut from_end4, _, _, _] = *s {
83 | ^^^^^^^^^^^^^^^^^ mutable borrow occurs here
84 LL | nop(&[from_begin0, from_begin1, from_begin3, from_end4]);
85 | ----------- immutable borrow later used here
87 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
88 --> $DIR/borrowck-slice-pattern-element-loan.rs:82:20
90 LL | if let [ref first, ref second, ..] = *s {
91 | ---------- immutable borrow occurs here
92 LL | if let [_, ref mut tail..] = *s {
93 | ^^^^^^^^^^^^ mutable borrow occurs here
94 LL | nop(&[first, second]);
95 | ------ immutable borrow later used here
97 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
98 --> $DIR/borrowck-slice-pattern-element-loan.rs:100:17
100 LL | if let [.., ref second, ref first] = *s {
101 | ---------- immutable borrow occurs here
102 LL | if let [ref mut tail.., _] = *s {
103 | ^^^^^^^^^^^^ mutable borrow occurs here
104 LL | nop(&[first, second]);
105 | ------ immutable borrow later used here
107 error[E0502]: cannot borrow `s[..]` as mutable because it is also borrowed as immutable
108 --> $DIR/borrowck-slice-pattern-element-loan.rs:109:17
110 LL | if let [_, _, _, ref s1..] = *s {
111 | ------ immutable borrow occurs here
112 LL | if let [ref mut s2.., _, _, _] = *s {
113 | ^^^^^^^^^^ mutable borrow occurs here
114 LL | nop_subslice(s1);
115 | -- immutable borrow later used here
117 error: aborting due to 11 previous errors
119 For more information about this error, try `rustc --explain E0502`.