2019-11-11 04:39:52 -06:00
|
|
|
error[E0007]: cannot bind by-move with sub-bindings
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:16:9
|
2019-11-11 04:39:52 -06:00
|
|
|
|
|
|
|
|
LL | let a @ box &b = Box::new(&C);
|
|
|
|
| ^^^^^^^^^^ binds an already bound by-move value by moving it
|
|
|
|
|
|
|
|
error[E0007]: cannot bind by-move with sub-bindings
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:20:9
|
2019-11-11 04:39:52 -06:00
|
|
|
|
|
|
|
|
LL | let a @ box b = Box::new(C);
|
|
|
|
| ^^^^^^^^^ binds an already bound by-move value by moving it
|
|
|
|
|
2019-12-14 20:50:55 -06:00
|
|
|
error[E0007]: cannot bind by-move with sub-bindings
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:32:25
|
2019-12-14 20:50:55 -06:00
|
|
|
|
|
|
|
|
LL | match Box::new(C) { a @ box b => {} }
|
|
|
|
| ^^^^^^^^^ binds an already bound by-move value by moving it
|
|
|
|
|
2019-11-11 04:39:52 -06:00
|
|
|
error[E0009]: cannot bind by-move and by-ref in the same pattern
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:36:21
|
2019-11-11 04:39:52 -06:00
|
|
|
|
|
|
|
|
LL | let ref a @ box b = Box::new(NC);
|
|
|
|
| ------------^
|
|
|
|
| | |
|
|
|
|
| | by-move pattern here
|
2019-12-14 11:20:13 -06:00
|
|
|
| by-ref pattern here
|
2019-11-11 04:39:52 -06:00
|
|
|
|
2019-12-14 17:32:20 -06:00
|
|
|
error: cannot borrow `a` as mutable because it is also borrowed as immutable
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:38:9
|
2019-12-14 17:50:44 -06:00
|
|
|
|
|
|
|
|
LL | let ref a @ box ref mut b = Box::new(nc());
|
|
|
|
| -----^^^^^^^---------
|
|
|
|
| | |
|
|
|
|
| | mutable borrow occurs here
|
|
|
|
| immutable borrow occurs here
|
|
|
|
|
|
|
|
error: cannot borrow `a` as mutable because it is also borrowed as immutable
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:40:9
|
2019-12-14 17:32:20 -06:00
|
|
|
|
|
|
|
|
LL | let ref a @ box ref mut b = Box::new(NC);
|
|
|
|
| -----^^^^^^^---------
|
|
|
|
| | |
|
|
|
|
| | mutable borrow occurs here
|
|
|
|
| immutable borrow occurs here
|
|
|
|
|
|
|
|
error: cannot borrow `a` as mutable because it is also borrowed as immutable
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:42:9
|
2019-12-14 17:32:20 -06:00
|
|
|
|
|
|
|
|
LL | let ref a @ box ref mut b = Box::new(NC);
|
|
|
|
| -----^^^^^^^---------
|
|
|
|
| | |
|
|
|
|
| | mutable borrow occurs here
|
|
|
|
| immutable borrow occurs here
|
|
|
|
|
|
|
|
error: cannot borrow `a` as mutable because it is also borrowed as immutable
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:45:9
|
2019-12-14 17:32:20 -06:00
|
|
|
|
|
|
|
|
LL | let ref a @ box ref mut b = Box::new(NC);
|
|
|
|
| -----^^^^^^^---------
|
|
|
|
| | |
|
|
|
|
| | mutable borrow occurs here
|
|
|
|
| immutable borrow occurs here
|
|
|
|
|
|
|
|
error: cannot borrow `a` as immutable because it is also borrowed as mutable
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:51:9
|
2019-12-14 17:32:20 -06:00
|
|
|
|
|
|
|
|
LL | let ref mut a @ box ref b = Box::new(NC);
|
|
|
|
| ---------^^^^^^^-----
|
|
|
|
| | |
|
|
|
|
| | immutable borrow occurs here
|
|
|
|
| mutable borrow occurs here
|
|
|
|
|
2019-12-14 20:50:55 -06:00
|
|
|
error: cannot borrow `a` as immutable because it is also borrowed as mutable
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:65:9
|
2019-12-14 20:50:55 -06:00
|
|
|
|
|
|
|
|
LL | ref mut a @ box ref b => {
|
|
|
|
| ---------^^^^^^^-----
|
|
|
|
| | |
|
|
|
|
| | immutable borrow occurs here
|
|
|
|
| mutable borrow occurs here
|
|
|
|
|
2019-12-14 21:29:34 -06:00
|
|
|
error[E0009]: cannot bind by-move and by-ref in the same pattern
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:74:38
|
2019-12-14 21:29:34 -06:00
|
|
|
|
|
|
|
|
LL | box [Ok(a), ref xs @ .., Err(b)] => {}
|
|
|
|
| ----------- ^ by-move pattern here
|
|
|
|
| |
|
|
|
|
| by-ref pattern here
|
|
|
|
|
|
|
|
error[E0009]: cannot bind by-move and by-ref in the same pattern
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:80:46
|
2019-12-14 21:29:34 -06:00
|
|
|
|
|
|
|
|
LL | [Ok(box ref a), ref xs @ .., Err(box b), Err(box ref mut c)] => {}
|
|
|
|
| ----- ----------- ^ --------- by-ref pattern here
|
|
|
|
| | | |
|
|
|
|
| | | by-move pattern here
|
|
|
|
| | by-ref pattern here
|
|
|
|
| by-ref pattern here
|
|
|
|
|
2019-12-14 20:50:55 -06:00
|
|
|
error[E0007]: cannot bind by-move with sub-bindings
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:24:11
|
2019-12-14 20:50:55 -06:00
|
|
|
|
|
|
|
|
LL | fn f1(a @ box &b: Box<&C>) {}
|
|
|
|
| ^^^^^^^^^^ binds an already bound by-move value by moving it
|
|
|
|
|
|
|
|
error[E0007]: cannot bind by-move with sub-bindings
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:28:11
|
2019-12-14 20:50:55 -06:00
|
|
|
|
|
|
|
|
LL | fn f2(a @ box b: Box<C>) {}
|
|
|
|
| ^^^^^^^^^ binds an already bound by-move value by moving it
|
|
|
|
|
|
|
|
error: cannot borrow `a` as immutable because it is also borrowed as mutable
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:57:11
|
2019-12-14 20:50:55 -06:00
|
|
|
|
|
|
|
|
LL | fn f5(ref mut a @ box ref b: Box<NC>) {
|
|
|
|
| ---------^^^^^^^-----
|
|
|
|
| | |
|
|
|
|
| | immutable borrow occurs here
|
|
|
|
| mutable borrow occurs here
|
|
|
|
|
2019-11-11 04:39:52 -06:00
|
|
|
error[E0382]: use of moved value
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:16:18
|
2019-11-11 04:39:52 -06:00
|
|
|
|
|
|
|
|
LL | let a @ box &b = Box::new(&C);
|
|
|
|
| ---------^ ------------ move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait
|
|
|
|
| | |
|
|
|
|
| | value used here after move
|
|
|
|
| value moved here
|
|
|
|
|
|
|
|
error[E0382]: use of moved value
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:20:17
|
2019-11-11 04:39:52 -06:00
|
|
|
|
|
|
|
|
LL | let a @ box b = Box::new(C);
|
|
|
|
| --------^ ----------- move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
|
|
|
|
| | |
|
|
|
|
| | value used here after move
|
|
|
|
| value moved here
|
|
|
|
|
2019-12-14 20:50:55 -06:00
|
|
|
error[E0382]: use of moved value
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:32:33
|
2019-12-14 20:50:55 -06:00
|
|
|
|
|
|
|
|
LL | match Box::new(C) { a @ box b => {} }
|
|
|
|
| ----------- --------^
|
|
|
|
| | | |
|
|
|
|
| | | value used here after move
|
|
|
|
| | value moved here
|
|
|
|
| move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
|
|
|
|
|
2019-11-11 04:39:52 -06:00
|
|
|
error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:45:21
|
2019-11-11 04:39:52 -06:00
|
|
|
|
|
|
|
|
LL | let ref a @ box ref mut b = Box::new(NC);
|
|
|
|
| ------------^^^^^^^^^
|
|
|
|
| | |
|
|
|
|
| | mutable borrow occurs here
|
|
|
|
| immutable borrow occurs here
|
|
|
|
...
|
|
|
|
LL | drop(a);
|
|
|
|
| - immutable borrow later used here
|
|
|
|
|
|
|
|
error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:51:25
|
2019-11-11 04:39:52 -06:00
|
|
|
|
|
|
|
|
LL | let ref mut a @ box ref b = Box::new(NC);
|
|
|
|
| ----------------^^^^^
|
|
|
|
| | |
|
|
|
|
| | immutable borrow occurs here
|
|
|
|
| mutable borrow occurs here
|
2019-12-14 17:32:20 -06:00
|
|
|
...
|
2019-11-11 04:39:52 -06:00
|
|
|
LL | *a = Box::new(NC);
|
|
|
|
| -- mutable borrow later used here
|
|
|
|
|
2019-12-14 20:50:55 -06:00
|
|
|
error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:65:25
|
2019-12-14 20:50:55 -06:00
|
|
|
|
|
|
|
|
LL | ref mut a @ box ref b => {
|
|
|
|
| ----------------^^^^^
|
|
|
|
| | |
|
|
|
|
| | immutable borrow occurs here
|
|
|
|
| mutable borrow occurs here
|
|
|
|
...
|
|
|
|
LL | *a = Box::new(NC);
|
|
|
|
| -- mutable borrow later used here
|
|
|
|
|
|
|
|
error[E0382]: use of moved value
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:24:20
|
2019-12-14 20:50:55 -06:00
|
|
|
|
|
|
|
|
LL | fn f1(a @ box &b: Box<&C>) {}
|
|
|
|
| ---------^
|
|
|
|
| | |
|
|
|
|
| | value used here after move
|
|
|
|
| value moved here
|
|
|
|
| move occurs because value has type `std::boxed::Box<&C>`, which does not implement the `Copy` trait
|
|
|
|
|
|
|
|
error[E0382]: use of moved value
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:28:19
|
2019-12-14 20:50:55 -06:00
|
|
|
|
|
|
|
|
LL | fn f2(a @ box b: Box<C>) {}
|
|
|
|
| --------^
|
|
|
|
| | |
|
|
|
|
| | value used here after move
|
|
|
|
| value moved here
|
|
|
|
| move occurs because value has type `std::boxed::Box<C>`, which does not implement the `Copy` trait
|
|
|
|
|
|
|
|
error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable
|
2019-12-29 18:23:42 -06:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:57:27
|
2019-12-14 20:50:55 -06:00
|
|
|
|
|
|
|
|
LL | fn f5(ref mut a @ box ref b: Box<NC>) {
|
|
|
|
| ----------------^^^^^
|
|
|
|
| | |
|
|
|
|
| | immutable borrow occurs here
|
|
|
|
| mutable borrow occurs here
|
|
|
|
...
|
|
|
|
LL | *a = Box::new(NC);
|
|
|
|
| -- mutable borrow later used here
|
|
|
|
|
2019-12-14 21:29:34 -06:00
|
|
|
error: aborting due to 24 previous errors
|
2019-11-11 04:39:52 -06:00
|
|
|
|
|
|
|
Some errors have detailed explanations: E0007, E0009, E0382, E0502.
|
|
|
|
For more information about an error, try `rustc --explain E0007`.
|