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 | | value is mutably borrowed by `bar` here
8 | value is borrowed by `foo` 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 | | value is mutably borrowed by `s` here
17 | value is borrowed by `foo` 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 @ [.., _] => (),
29 | ^^ value borrowed here after move
31 help: borrow this binding in the pattern to avoid moving the value
33 LL | ref a @ [.., _] => (),
36 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
37 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:28:5
39 LL | ref mut foo @ [.., _] => Some(foo),
40 | ----------- mutable borrow occurs here
43 | ^^ immutable borrow occurs here
46 | - mutable borrow later used here
48 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
49 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:50:5
51 LL | [ref foo @ .., ref bar] => Some(foo),
52 | ------- immutable borrow occurs here
55 | ^^^^^^ mutable borrow occurs here
58 | - immutable borrow later used here
60 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
61 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:62:5
63 LL | ref foo @ [.., ref bar] => Some(foo),
64 | ------- immutable borrow occurs here
67 | ^^^^^^ mutable borrow occurs here
70 | - immutable borrow later used here
72 error[E0382]: borrow of moved value: `x`
73 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:76:5
75 LL | fn bindings_after_at_or_patterns_move(x: Option<Test>) {
76 | - move occurs because `x` has type `Option<Test>`, which does not implement the `Copy` trait
78 LL | foo @ Some(Test::Foo | Test::Bar) => (),
79 | --- value moved here
82 | ^^ value borrowed here after move
84 help: borrow this binding in the pattern to avoid moving the value
86 LL | ref foo @ Some(Test::Foo | Test::Bar) => (),
89 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
90 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:86:5
92 LL | ref foo @ Some(Test::Foo | Test::Bar) => Some(foo),
93 | ------- immutable borrow occurs here
96 | ^^^^^^ mutable borrow occurs here
99 | - immutable borrow later used here
101 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
102 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:98:5
104 LL | ref mut foo @ Some(Test::Foo | Test::Bar) => Some(foo),
105 | ----------- mutable borrow occurs here
108 | ^^ immutable borrow occurs here
111 | - mutable borrow later used here
113 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
114 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:112:5
116 LL | ref foo @ Some(box ref s) => Some(foo),
117 | ------- immutable borrow occurs here
120 | ^^^^^^ mutable borrow occurs here
123 | - immutable borrow later used here
125 error[E0382]: borrow of moved value: `x`
126 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:134:5
128 LL | fn bindings_after_at_slice_patterns_or_patterns_moves(x: [Option<Test>; 4]) {
129 | - move occurs because `x` has type `[Option<Test>; 4]`, which does not implement the `Copy` trait
131 LL | a @ [.., Some(Test::Foo | Test::Bar)] => (),
135 | ^^ value borrowed here after move
137 help: borrow this binding in the pattern to avoid moving the value
139 LL | ref a @ [.., Some(Test::Foo | Test::Bar)] => (),
142 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
143 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:144:5
145 LL | ref a @ [ref b @ .., Some(Test::Foo | Test::Bar)] => Some(a),
146 | ----- immutable borrow occurs here
149 | ^^^^^^ mutable borrow occurs here
152 | - immutable borrow later used here
154 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
155 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:156:5
157 LL | ref a @ [ref b @ .., Some(Test::Foo | Test::Bar)] => Some(b),
158 | ----- immutable borrow occurs here
161 | ^^^^^^ mutable borrow occurs here
164 | - immutable borrow later used here
166 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
167 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:170:5
169 LL | [_, ref a @ Some(box ref b), ..] => Some(a),
170 | ----- immutable borrow occurs here
173 | ^^^^^^ mutable borrow occurs here
176 | - immutable borrow later used here
178 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
179 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:186:5
181 LL | [_, ref a @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
182 | ----- immutable borrow occurs here
185 | ^^^^^^ mutable borrow occurs here
188 | - immutable borrow later used here
190 error[E0502]: cannot borrow `x` as immutable because it is also borrowed as mutable
191 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:200:5
193 LL | [_, ref mut a @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
194 | --------- mutable borrow occurs here
197 | ^^ immutable borrow occurs here
200 | - mutable borrow later used here
202 error[E0502]: cannot borrow `x` as mutable because it is also borrowed as immutable
203 --> $DIR/bindings-after-at-or-patterns-slice-patterns-box-patterns.rs:214:5
205 LL | ref a @ [_, ref b @ Some(box Test::Foo | box Test::Bar), ..] => Some(a),
206 | ----- immutable borrow occurs here
209 | ^^^^^^ mutable borrow occurs here
212 | - immutable borrow later used here
214 error: aborting due to 17 previous errors
216 Some errors have detailed explanations: E0382, E0502.
217 For more information about an error, try `rustc --explain E0382`.