@@ -7,25 +7,25 @@ LL | #![feature(bindings_after_at)]
77   = note: `#[warn(incomplete_features)]` on by default
88
99error[E0007]: cannot bind by-move with sub-bindings
10-   --> $DIR/borrowck-pat-at-and-box.rs:17 :9
10+   --> $DIR/borrowck-pat-at-and-box.rs:18 :9
1111   |
1212LL |     let a @ box &b = Box::new(&C);
1313   |         ^^^^^^^^^^ binds an already bound by-move value by moving it
1414
1515error[E0007]: cannot bind by-move with sub-bindings
16-   --> $DIR/borrowck-pat-at-and-box.rs:21 :9
16+   --> $DIR/borrowck-pat-at-and-box.rs:22 :9
1717   |
1818LL |     let a @ box b = Box::new(C);
1919   |         ^^^^^^^^^ binds an already bound by-move value by moving it
2020
2121error[E0007]: cannot bind by-move with sub-bindings
22-   --> $DIR/borrowck-pat-at-and-box.rs:33 :25
22+   --> $DIR/borrowck-pat-at-and-box.rs:34 :25
2323   |
2424LL |     match Box::new(C) { a @ box b => {} }
2525   |                         ^^^^^^^^^ binds an already bound by-move value by moving it
2626
2727error[E0009]: cannot bind by-move and by-ref in the same pattern
28-   --> $DIR/borrowck-pat-at-and-box.rs:60 :21
28+   --> $DIR/borrowck-pat-at-and-box.rs:38 :21
2929   |
3030LL |     let ref a @ box b = Box::new(NC);
3131   |         ------------^
@@ -34,7 +34,7 @@ LL |     let ref a @ box b = Box::new(NC);
3434   |         by-ref pattern here
3535
3636error: cannot borrow `a` as mutable because it is also borrowed as immutable
37-   --> $DIR/borrowck-pat-at-and-box.rs:78 :9
37+   --> $DIR/borrowck-pat-at-and-box.rs:40 :9
3838   |
3939LL |     let ref a @ box ref mut b = Box::new(nc());
4040   |         -----^^^^^^^---------
@@ -43,7 +43,7 @@ LL |     let ref a @ box ref mut b = Box::new(nc());
4343   |         immutable borrow occurs here
4444
4545error: cannot borrow `a` as mutable because it is also borrowed as immutable
46-   --> $DIR/borrowck-pat-at-and-box.rs:80 :9
46+   --> $DIR/borrowck-pat-at-and-box.rs:42 :9
4747   |
4848LL |     let ref a @ box ref mut b = Box::new(NC);
4949   |         -----^^^^^^^---------
@@ -52,7 +52,7 @@ LL |     let ref a @ box ref mut b = Box::new(NC);
5252   |         immutable borrow occurs here
5353
5454error: cannot borrow `a` as mutable because it is also borrowed as immutable
55-   --> $DIR/borrowck-pat-at-and-box.rs:82 :9
55+   --> $DIR/borrowck-pat-at-and-box.rs:44 :9
5656   |
5757LL |     let ref a @ box ref mut b = Box::new(NC);
5858   |         -----^^^^^^^---------
@@ -61,7 +61,7 @@ LL |     let ref a @ box ref mut b = Box::new(NC);
6161   |         immutable borrow occurs here
6262
6363error: cannot borrow `a` as mutable because it is also borrowed as immutable
64-   --> $DIR/borrowck-pat-at-and-box.rs:85 :9
64+   --> $DIR/borrowck-pat-at-and-box.rs:47 :9
6565   |
6666LL |     let ref a @ box ref mut b = Box::new(NC);
6767   |         -----^^^^^^^---------
@@ -70,7 +70,7 @@ LL |     let ref a @ box ref mut b = Box::new(NC);
7070   |         immutable borrow occurs here
7171
7272error: cannot borrow `a` as immutable because it is also borrowed as mutable
73-   --> $DIR/borrowck-pat-at-and-box.rs:91 :9
73+   --> $DIR/borrowck-pat-at-and-box.rs:53 :9
7474   |
7575LL |     let ref mut a @ box ref b = Box::new(NC);
7676   |         ---------^^^^^^^-----
@@ -79,28 +79,46 @@ LL |     let ref mut a @ box ref b = Box::new(NC);
7979   |         mutable borrow occurs here
8080
8181error: cannot borrow `a` as immutable because it is also borrowed as mutable
82-   --> $DIR/borrowck-pat-at-and-box.rs:105 :9
82+   --> $DIR/borrowck-pat-at-and-box.rs:67 :9
8383   |
8484LL |         ref mut a @ box ref b => {
8585   |         ---------^^^^^^^-----
8686   |         |               |
8787   |         |               immutable borrow occurs here
8888   |         mutable borrow occurs here
8989
90+ error[E0009]: cannot bind by-move and by-ref in the same pattern
91+   --> $DIR/borrowck-pat-at-and-box.rs:76:38
92+    |
93+ LL |         box [Ok(a), ref xs @ .., Err(b)] => {}
94+    |                     -----------      ^ by-move pattern here
95+    |                     |
96+    |                     by-ref pattern here
97+ 
98+ error[E0009]: cannot bind by-move and by-ref in the same pattern
99+   --> $DIR/borrowck-pat-at-and-box.rs:82:46
100+    |
101+ LL |         [Ok(box ref a), ref xs @ .., Err(box b), Err(box ref mut c)] => {}
102+    |                 -----   -----------          ^           --------- by-ref pattern here
103+    |                 |       |                    |
104+    |                 |       |                    by-move pattern here
105+    |                 |       by-ref pattern here
106+    |                 by-ref pattern here
107+ 
90108error[E0007]: cannot bind by-move with sub-bindings
91-   --> $DIR/borrowck-pat-at-and-box.rs:25 :11
109+   --> $DIR/borrowck-pat-at-and-box.rs:26 :11
92110   |
93111LL |     fn f1(a @ box &b: Box<&C>) {}
94112   |           ^^^^^^^^^^ binds an already bound by-move value by moving it
95113
96114error[E0007]: cannot bind by-move with sub-bindings
97-   --> $DIR/borrowck-pat-at-and-box.rs:29 :11
115+   --> $DIR/borrowck-pat-at-and-box.rs:30 :11
98116   |
99117LL |     fn f2(a @ box b: Box<C>) {}
100118   |           ^^^^^^^^^ binds an already bound by-move value by moving it
101119
102120error: cannot borrow `a` as immutable because it is also borrowed as mutable
103-   --> $DIR/borrowck-pat-at-and-box.rs:97 :11
121+   --> $DIR/borrowck-pat-at-and-box.rs:59 :11
104122   |
105123LL |     fn f5(ref mut a @ box ref b: Box<NC>) {
106124   |           ---------^^^^^^^-----
@@ -109,7 +127,7 @@ LL |     fn f5(ref mut a @ box ref b: Box<NC>) {
109127   |           mutable borrow occurs here
110128
111129error[E0382]: use of moved value
112-   --> $DIR/borrowck-pat-at-and-box.rs:17 :18
130+   --> $DIR/borrowck-pat-at-and-box.rs:18 :18
113131   |
114132LL |     let a @ box &b = Box::new(&C);
115133   |         ---------^   ------------ move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait
@@ -118,7 +136,7 @@ LL |     let a @ box &b = Box::new(&C);
118136   |         value moved here
119137
120138error[E0382]: use of moved value
121-   --> $DIR/borrowck-pat-at-and-box.rs:21 :17
139+   --> $DIR/borrowck-pat-at-and-box.rs:22 :17
122140   |
123141LL |     let a @ box b = Box::new(C);
124142   |         --------^   ----------- move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
@@ -127,7 +145,7 @@ LL |     let a @ box b = Box::new(C);
127145   |         value moved here
128146
129147error[E0382]: use of moved value
130-   --> $DIR/borrowck-pat-at-and-box.rs:33 :33
148+   --> $DIR/borrowck-pat-at-and-box.rs:34 :33
131149   |
132150LL |     match Box::new(C) { a @ box b => {} }
133151   |           -----------   --------^
@@ -137,7 +155,7 @@ LL |     match Box::new(C) { a @ box b => {} }
137155   |           move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
138156
139157error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
140-   --> $DIR/borrowck-pat-at-and-box.rs:85 :21
158+   --> $DIR/borrowck-pat-at-and-box.rs:47 :21
141159   |
142160LL |     let ref a @ box ref mut b = Box::new(NC);
143161   |         ------------^^^^^^^^^
@@ -149,7 +167,7 @@ LL |     drop(a);
149167   |          - immutable borrow later used here
150168
151169error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
152-   --> $DIR/borrowck-pat-at-and-box.rs:91 :25
170+   --> $DIR/borrowck-pat-at-and-box.rs:53 :25
153171   |
154172LL |     let ref mut a @ box ref b = Box::new(NC);
155173   |         ----------------^^^^^
@@ -161,7 +179,7 @@ LL |     *a = Box::new(NC);
161179   |     -- mutable borrow later used here
162180
163181error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
164-   --> $DIR/borrowck-pat-at-and-box.rs:105 :25
182+   --> $DIR/borrowck-pat-at-and-box.rs:67 :25
165183   |
166184LL |         ref mut a @ box ref b => {
167185   |         ----------------^^^^^
@@ -173,7 +191,7 @@ LL |             *a = Box::new(NC);
173191   |             -- mutable borrow later used here
174192
175193error[E0382]: use of moved value
176-   --> $DIR/borrowck-pat-at-and-box.rs:25 :20
194+   --> $DIR/borrowck-pat-at-and-box.rs:26 :20
177195   |
178196LL |     fn f1(a @ box &b: Box<&C>) {}
179197   |           ---------^
@@ -183,7 +201,7 @@ LL |     fn f1(a @ box &b: Box<&C>) {}
183201   |           move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait
184202
185203error[E0382]: use of moved value
186-   --> $DIR/borrowck-pat-at-and-box.rs:29 :19
204+   --> $DIR/borrowck-pat-at-and-box.rs:30 :19
187205   |
188206LL |     fn f2(a @ box b: Box<C>) {}
189207   |           --------^
@@ -193,7 +211,7 @@ LL |     fn f2(a @ box b: Box<C>) {}
193211   |           move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
194212
195213error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
196-   --> $DIR/borrowck-pat-at-and-box.rs:97 :27
214+   --> $DIR/borrowck-pat-at-and-box.rs:59 :27
197215   |
198216LL |     fn f5(ref mut a @ box ref b: Box<NC>) {
199217   |           ----------------^^^^^
@@ -204,7 +222,7 @@ LL |     fn f5(ref mut a @ box ref b: Box<NC>) {
204222LL |         *a = Box::new(NC);
205223   |         -- mutable borrow later used here
206224
207- error: aborting due to 22  previous errors
225+ error: aborting due to 24  previous errors
208226
209227Some errors have detailed explanations: E0007, E0009, E0382, E0502.
210228For more information about an error, try `rustc --explain E0007`.
0 commit comments