1 error: cannot borrow value as mutable because it is also borrowed as immutable
2 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:36:9
4 LL | ref foo @ [.., ref mut bar] => (),
5 | -------^^^^^^^^-----------^
7 | | mutable borrow, by `bar`, occurs here
8 | immutable borrow, by `foo`, occurs here
10 error: cannot borrow value as mutable because it is also borrowed as immutable
11 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:120:9
13 LL | ref foo @ Some(box ref mut s) => (),
14 | -------^^^^^^^^^^^^---------^
16 | | mutable borrow, by `s`, occurs here
17 | immutable borrow, by `foo`, occurs here
19 error[E0382]: borrow of moved value: `x`
20 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:18:5
22 LL | fn bindings_after_at_slice_patterns_move_binding(x: [String; 4]) {
23 | - move occurs because `x` has type `[String; 4]`, which does not implement the `Copy` trait
25 LL | a @ [.., _] => (),
26 | ----------- value moved here
29 | ^^ value borrowed here after move
31 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
32 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:28:5
34 LL | ref mut foo @ [.., _] => Some(foo),
35 | --------------------- mutable borrow occurs here
38 | ^^ immutable borrow occurs here
41 | - mutable borrow later used here
43 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
44 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:50:5
46 LL | [ref foo @ .., ref bar] => Some(foo),
47 | ------------ immutable borrow occurs here
50 | ^^^^^^ mutable borrow occurs here
53 | - immutable borrow later used here
55 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
56 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:62:5
58 LL | ref foo @ [.., ref bar] => Some(foo),
59 | ----------------------- immutable borrow occurs here
62 | ^^^^^^ mutable borrow occurs here
65 | - immutable borrow later used here
67 error[E0382]: borrow of moved value: `x`
68 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:76:5
70 LL | fn bindings_after_at_or_patterns_move(x: Option<Test>) {
71 | - move occurs because `x` has type `Option<Test>`, which does not implement the `Copy` trait
73 LL | foo @ Some(Test::Foo | Test::Bar) => (),
74 | ---------------------------------
80 | ^^ value borrowed here after move
82 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
83 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:86:5
85 LL | ref foo @ Some(Test::Foo | Test::Bar) => Some(foo),
86 | ------------------------------------- immutable borrow occurs here
89 | ^^^^^^ mutable borrow occurs here
92 | - immutable borrow later used here
94 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
95 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:98:5
97 LL | ref mut foo @ Some(Test::Foo | Test::Bar) => Some(foo),
98 | ----------------------------------------- mutable borrow occurs here
101 | ^^ immutable borrow occurs here
104 | - mutable borrow later used here
106 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
107 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:112:5
109 LL | ref foo @ Some(box ref s) => Some(foo),
110 | ------------------------- immutable borrow occurs here
113 | ^^^^^^ mutable borrow occurs here
116 | - immutable borrow later used here
118 error[E0382]: borrow of moved value: `x`
119 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:134:5
121 LL | fn bindings_after_at_slice_patterns_or_patterns_moves(x: [Option<Test>; 4]) {
122 | - move occurs because `x` has type `[Option<Test>; 4]`, which does not implement the `Copy` trait
124 LL | a @ [.., Some(Test::Foo | Test::Bar)] => (),
125 | -------------------------------------
131 | ^^ value borrowed here after move
133 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
134 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:144:5
136 LL | ref a @ [ref b @ .., Some(Test::Foo | Test::Bar)] => Some(a),
137 | ------------------------------------------------- immutable borrow occurs here
140 | ^^^^^^ mutable borrow occurs here
143 | - immutable borrow later used here
145 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
146 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:156:5
148 LL | ref a @ [ref b @ .., Some(Test::Foo | Test::Bar)] => Some(b),
149 | ---------- immutable borrow occurs here
152 | ^^^^^^ mutable borrow occurs here
155 | - immutable borrow later used here
157 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
158 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:170:5
160 LL | [_, ref a @ Some(box ref b), ..] => Some(a),
161 | ----------------------- immutable borrow occurs here
164 | ^^^^^^ mutable borrow occurs here
167 | - immutable borrow later used here
169 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
170 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:186:5
172 LL | [_, ref a @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
173 | ------------------------------------------- immutable borrow occurs here
176 | ^^^^^^ mutable borrow occurs here
179 | - immutable borrow later used here
181 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
182 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:200:5
184 LL | [_, ref mut a @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
185 | ----------------------------------------------- mutable borrow occurs here
188 | ^^ immutable borrow occurs here
191 | - mutable borrow later used here
193 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
194 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:214:5
196 LL | ref a @ [_, ref b @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
197 | ------------------------------------------------------------ immutable borrow occurs here
200 | ^^^^^^ mutable borrow occurs here
203 | - immutable borrow later used here
205 error: aborting due to 17 previous errors
207 Some errors have detailed explanations: E0382, E0502.
208 For more information about an error, try `rustc --explain E0382`.