]> git.lizzy.rs Git - rust.git/blob - src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr
slice_patterns: remove gates in tests
[rust.git] / src / test / ui / pattern / bindings-after-at / borrowck-pat-at-and-box.stderr
1 error[E0007]: cannot bind by-move with sub-bindings
2   --> $DIR/borrowck-pat-at-and-box.rs:16:9
3    |
4 LL |     let a @ box &b = Box::new(&C);
5    |         ^^^^^^^^^^ binds an already bound by-move value by moving it
6
7 error[E0007]: cannot bind by-move with sub-bindings
8   --> $DIR/borrowck-pat-at-and-box.rs:20:9
9    |
10 LL |     let a @ box b = Box::new(C);
11    |         ^^^^^^^^^ binds an already bound by-move value by moving it
12
13 error[E0007]: cannot bind by-move with sub-bindings
14   --> $DIR/borrowck-pat-at-and-box.rs:32:25
15    |
16 LL |     match Box::new(C) { a @ box b => {} }
17    |                         ^^^^^^^^^ binds an already bound by-move value by moving it
18
19 error[E0009]: cannot bind by-move and by-ref in the same pattern
20   --> $DIR/borrowck-pat-at-and-box.rs:36:21
21    |
22 LL |     let ref a @ box b = Box::new(NC);
23    |         ------------^
24    |         |           |
25    |         |           by-move pattern here
26    |         by-ref pattern here
27
28 error: cannot borrow `a` as mutable because it is also borrowed as immutable
29   --> $DIR/borrowck-pat-at-and-box.rs:38:9
30    |
31 LL |     let ref a @ box ref mut b = Box::new(nc());
32    |         -----^^^^^^^---------
33    |         |           |
34    |         |           mutable borrow occurs here
35    |         immutable borrow occurs here
36
37 error: cannot borrow `a` as mutable because it is also borrowed as immutable
38   --> $DIR/borrowck-pat-at-and-box.rs:40:9
39    |
40 LL |     let ref a @ box ref mut b = Box::new(NC);
41    |         -----^^^^^^^---------
42    |         |           |
43    |         |           mutable borrow occurs here
44    |         immutable borrow occurs here
45
46 error: cannot borrow `a` as mutable because it is also borrowed as immutable
47   --> $DIR/borrowck-pat-at-and-box.rs:42:9
48    |
49 LL |     let ref a @ box ref mut b = Box::new(NC);
50    |         -----^^^^^^^---------
51    |         |           |
52    |         |           mutable borrow occurs here
53    |         immutable borrow occurs here
54
55 error: cannot borrow `a` as mutable because it is also borrowed as immutable
56   --> $DIR/borrowck-pat-at-and-box.rs:45:9
57    |
58 LL |     let ref a @ box ref mut b = Box::new(NC);
59    |         -----^^^^^^^---------
60    |         |           |
61    |         |           mutable borrow occurs here
62    |         immutable borrow occurs here
63
64 error: cannot borrow `a` as immutable because it is also borrowed as mutable
65   --> $DIR/borrowck-pat-at-and-box.rs:51:9
66    |
67 LL |     let ref mut a @ box ref b = Box::new(NC);
68    |         ---------^^^^^^^-----
69    |         |               |
70    |         |               immutable borrow occurs here
71    |         mutable borrow occurs here
72
73 error: cannot borrow `a` as immutable because it is also borrowed as mutable
74   --> $DIR/borrowck-pat-at-and-box.rs:65:9
75    |
76 LL |         ref mut a @ box ref b => {
77    |         ---------^^^^^^^-----
78    |         |               |
79    |         |               immutable borrow occurs here
80    |         mutable borrow occurs here
81
82 error[E0009]: cannot bind by-move and by-ref in the same pattern
83   --> $DIR/borrowck-pat-at-and-box.rs:74:38
84    |
85 LL |         box [Ok(a), ref xs @ .., Err(b)] => {}
86    |                     -----------      ^ by-move pattern here
87    |                     |
88    |                     by-ref pattern here
89
90 error[E0009]: cannot bind by-move and by-ref in the same pattern
91   --> $DIR/borrowck-pat-at-and-box.rs:80:46
92    |
93 LL |         [Ok(box ref a), ref xs @ .., Err(box b), Err(box ref mut c)] => {}
94    |                 -----   -----------          ^           --------- by-ref pattern here
95    |                 |       |                    |
96    |                 |       |                    by-move pattern here
97    |                 |       by-ref pattern here
98    |                 by-ref pattern here
99
100 error[E0007]: cannot bind by-move with sub-bindings
101   --> $DIR/borrowck-pat-at-and-box.rs:24:11
102    |
103 LL |     fn f1(a @ box &b: Box<&C>) {}
104    |           ^^^^^^^^^^ binds an already bound by-move value by moving it
105
106 error[E0007]: cannot bind by-move with sub-bindings
107   --> $DIR/borrowck-pat-at-and-box.rs:28:11
108    |
109 LL |     fn f2(a @ box b: Box<C>) {}
110    |           ^^^^^^^^^ binds an already bound by-move value by moving it
111
112 error: cannot borrow `a` as immutable because it is also borrowed as mutable
113   --> $DIR/borrowck-pat-at-and-box.rs:57:11
114    |
115 LL |     fn f5(ref mut a @ box ref b: Box<NC>) {
116    |           ---------^^^^^^^-----
117    |           |               |
118    |           |               immutable borrow occurs here
119    |           mutable borrow occurs here
120
121 error[E0382]: use of moved value
122   --> $DIR/borrowck-pat-at-and-box.rs:16:18
123    |
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
126    |         |        |
127    |         |        value used here after move
128    |         value moved here
129
130 error[E0382]: use of moved value
131   --> $DIR/borrowck-pat-at-and-box.rs:20:17
132    |
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
135    |         |       |
136    |         |       value used here after move
137    |         value moved here
138
139 error[E0382]: use of moved value
140   --> $DIR/borrowck-pat-at-and-box.rs:32:33
141    |
142 LL |     match Box::new(C) { a @ box b => {} }
143    |           -----------   --------^
144    |           |             |       |
145    |           |             |       value used here after move
146    |           |             value moved here
147    |           move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
148
149 error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
150   --> $DIR/borrowck-pat-at-and-box.rs:45:21
151    |
152 LL |     let ref a @ box ref mut b = Box::new(NC);
153    |         ------------^^^^^^^^^
154    |         |           |
155    |         |           mutable borrow occurs here
156    |         immutable borrow occurs here
157 ...
158 LL |     drop(a);
159    |          - immutable borrow later used here
160
161 error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
162   --> $DIR/borrowck-pat-at-and-box.rs:51:25
163    |
164 LL |     let ref mut a @ box ref b = Box::new(NC);
165    |         ----------------^^^^^
166    |         |               |
167    |         |               immutable borrow occurs here
168    |         mutable borrow occurs here
169 ...
170 LL |     *a = Box::new(NC);
171    |     -- mutable borrow later used here
172
173 error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
174   --> $DIR/borrowck-pat-at-and-box.rs:65:25
175    |
176 LL |         ref mut a @ box ref b => {
177    |         ----------------^^^^^
178    |         |               |
179    |         |               immutable borrow occurs here
180    |         mutable borrow occurs here
181 ...
182 LL |             *a = Box::new(NC);
183    |             -- mutable borrow later used here
184
185 error[E0382]: use of moved value
186   --> $DIR/borrowck-pat-at-and-box.rs:24:20
187    |
188 LL |     fn f1(a @ box &b: Box<&C>) {}
189    |           ---------^
190    |           |        |
191    |           |        value used here after move
192    |           value moved here
193    |           move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait
194
195 error[E0382]: use of moved value
196   --> $DIR/borrowck-pat-at-and-box.rs:28:19
197    |
198 LL |     fn f2(a @ box b: Box<C>) {}
199    |           --------^
200    |           |       |
201    |           |       value used here after move
202    |           value moved here
203    |           move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
204
205 error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
206   --> $DIR/borrowck-pat-at-and-box.rs:57:27
207    |
208 LL |     fn f5(ref mut a @ box ref b: Box<NC>) {
209    |           ----------------^^^^^
210    |           |               |
211    |           |               immutable borrow occurs here
212    |           mutable borrow occurs here
213 ...
214 LL |         *a = Box::new(NC);
215    |         -- mutable borrow later used here
216
217 error: aborting due to 24 previous errors
218
219 Some errors have detailed explanations: E0007, E0009, E0382, E0502.
220 For more information about an error, try `rustc --explain E0007`.