1 error[E0007]: cannot bind by-move with sub-bindings
2 --> $DIR/borrowck-pat-at-and-box.rs:16:9
4 LL | let a @ box &b = Box::new(&C);
5 | ^^^^^^^^^^ binds an already bound by-move value by moving it
7 error[E0007]: cannot bind by-move with sub-bindings
8 --> $DIR/borrowck-pat-at-and-box.rs:20:9
10 LL | let a @ box b = Box::new(C);
11 | ^^^^^^^^^ binds an already bound by-move value by moving it
13 error[E0007]: cannot bind by-move with sub-bindings
14 --> $DIR/borrowck-pat-at-and-box.rs:32:25
16 LL | match Box::new(C) { a @ box b => {} }
17 | ^^^^^^^^^ binds an already bound by-move value by moving it
19 error[E0009]: cannot bind by-move and by-ref in the same pattern
20 --> $DIR/borrowck-pat-at-and-box.rs:36:21
22 LL | let ref a @ box b = Box::new(NC);
25 | | by-move pattern here
28 error: cannot borrow `a` as mutable because it is also borrowed as immutable
29 --> $DIR/borrowck-pat-at-and-box.rs:38:9
31 LL | let ref a @ box ref mut b = Box::new(nc());
32 | -----^^^^^^^---------
34 | | mutable borrow occurs here
35 | immutable borrow occurs here
37 error: cannot borrow `a` as mutable because it is also borrowed as immutable
38 --> $DIR/borrowck-pat-at-and-box.rs:40:9
40 LL | let ref a @ box ref mut b = Box::new(NC);
41 | -----^^^^^^^---------
43 | | mutable borrow occurs here
44 | immutable borrow occurs here
46 error: cannot borrow `a` as mutable because it is also borrowed as immutable
47 --> $DIR/borrowck-pat-at-and-box.rs:42:9
49 LL | let ref a @ box ref mut b = Box::new(NC);
50 | -----^^^^^^^---------
52 | | mutable borrow occurs here
53 | immutable borrow occurs here
55 error: cannot borrow `a` as mutable because it is also borrowed as immutable
56 --> $DIR/borrowck-pat-at-and-box.rs:45:9
58 LL | let ref a @ box ref mut b = Box::new(NC);
59 | -----^^^^^^^---------
61 | | mutable borrow occurs here
62 | immutable borrow occurs here
64 error: cannot borrow `a` as immutable because it is also borrowed as mutable
65 --> $DIR/borrowck-pat-at-and-box.rs:51:9
67 LL | let ref mut a @ box ref b = Box::new(NC);
68 | ---------^^^^^^^-----
70 | | immutable borrow occurs here
71 | mutable borrow occurs here
73 error: cannot borrow `a` as immutable because it is also borrowed as mutable
74 --> $DIR/borrowck-pat-at-and-box.rs:65:9
76 LL | ref mut a @ box ref b => {
77 | ---------^^^^^^^-----
79 | | immutable borrow occurs here
80 | mutable borrow occurs here
82 error[E0009]: cannot bind by-move and by-ref in the same pattern
83 --> $DIR/borrowck-pat-at-and-box.rs:74:38
85 LL | box [Ok(a), ref xs @ .., Err(b)] => {}
86 | ----------- ^ by-move pattern here
90 error[E0009]: cannot bind by-move and by-ref in the same pattern
91 --> $DIR/borrowck-pat-at-and-box.rs:80:46
93 LL | [Ok(box ref a), ref xs @ .., Err(box b), Err(box ref mut c)] => {}
94 | ----- ----------- ^ --------- by-ref pattern here
96 | | | by-move pattern here
97 | | by-ref pattern here
100 error[E0007]: cannot bind by-move with sub-bindings
101 --> $DIR/borrowck-pat-at-and-box.rs:24:11
103 LL | fn f1(a @ box &b: Box<&C>) {}
104 | ^^^^^^^^^^ binds an already bound by-move value by moving it
106 error[E0007]: cannot bind by-move with sub-bindings
107 --> $DIR/borrowck-pat-at-and-box.rs:28:11
109 LL | fn f2(a @ box b: Box<C>) {}
110 | ^^^^^^^^^ binds an already bound by-move value by moving it
112 error: cannot borrow `a` as immutable because it is also borrowed as mutable
113 --> $DIR/borrowck-pat-at-and-box.rs:57:11
115 LL | fn f5(ref mut a @ box ref b: Box<NC>) {
116 | ---------^^^^^^^-----
118 | | immutable borrow occurs here
119 | mutable borrow occurs here
121 error[E0382]: use of moved value
122 --> $DIR/borrowck-pat-at-and-box.rs:16:18
124 LL | let a @ box &b = Box::new(&C);
125 | ---------^ ------------ move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait
127 | | value used here after move
130 error[E0382]: use of moved value
131 --> $DIR/borrowck-pat-at-and-box.rs:20:17
133 LL | let a @ box b = Box::new(C);
134 | --------^ ----------- move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
136 | | value used here after move
139 error[E0382]: use of moved value
140 --> $DIR/borrowck-pat-at-and-box.rs:32:33
142 LL | match Box::new(C) { a @ box b => {} }
143 | ----------- --------^
145 | | | value used here after move
147 | move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
149 error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
150 --> $DIR/borrowck-pat-at-and-box.rs:45:21
152 LL | let ref a @ box ref mut b = Box::new(NC);
153 | ------------^^^^^^^^^
155 | | mutable borrow occurs here
156 | immutable borrow occurs here
159 | - immutable borrow later used here
161 error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
162 --> $DIR/borrowck-pat-at-and-box.rs:51:25
164 LL | let ref mut a @ box ref b = Box::new(NC);
165 | ----------------^^^^^
167 | | immutable borrow occurs here
168 | mutable borrow occurs here
170 LL | *a = Box::new(NC);
171 | -- mutable borrow later used here
173 error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
174 --> $DIR/borrowck-pat-at-and-box.rs:65:25
176 LL | ref mut a @ box ref b => {
177 | ----------------^^^^^
179 | | immutable borrow occurs here
180 | mutable borrow occurs here
182 LL | *a = Box::new(NC);
183 | -- mutable borrow later used here
185 error[E0382]: use of moved value
186 --> $DIR/borrowck-pat-at-and-box.rs:24:20
188 LL | fn f1(a @ box &b: Box<&C>) {}
191 | | value used here after move
193 | move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait
195 error[E0382]: use of moved value
196 --> $DIR/borrowck-pat-at-and-box.rs:28:19
198 LL | fn f2(a @ box b: Box<C>) {}
201 | | value used here after move
203 | move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
205 error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
206 --> $DIR/borrowck-pat-at-and-box.rs:57:27
208 LL | fn f5(ref mut a @ box ref b: Box<NC>) {
209 | ----------------^^^^^
211 | | immutable borrow occurs here
212 | mutable borrow occurs here
214 LL | *a = Box::new(NC);
215 | -- mutable borrow later used here
217 error: aborting due to 24 previous errors
219 Some errors have detailed explanations: E0007, E0009, E0382, E0502.
220 For more information about an error, try `rustc --explain E0007`.