2020-02-02 10:58:15 -06:00
|
|
|
error: cannot move out of value because it is borrowed
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:36:9
|
2019-11-11 04:39:52 -06:00
|
|
|
|
|
|
|
|
LL | let ref a @ box b = Box::new(NC);
|
2020-01-18 19:47:01 -06:00
|
|
|
| -----^^^^^^^-
|
2019-11-11 04:39:52 -06:00
|
|
|
| | |
|
2020-02-02 10:58:15 -06:00
|
|
|
| | value moved into `b` here
|
|
|
|
| value borrowed, by `a`, here
|
2019-11-11 04:39:52 -06:00
|
|
|
|
2020-02-02 10:58:15 -06:00
|
|
|
error: cannot borrow value as mutable because it is also borrowed as immutable
|
2020-08-30 13:59:56 -05: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());
|
|
|
|
| -----^^^^^^^---------
|
|
|
|
| | |
|
2020-02-02 10:58:15 -06:00
|
|
|
| | mutable borrow, by `b`, occurs here
|
|
|
|
| immutable borrow, by `a`, occurs here
|
2019-12-14 17:50:44 -06:00
|
|
|
|
2020-02-02 10:58:15 -06:00
|
|
|
error: cannot borrow value as mutable because it is also borrowed as immutable
|
2020-08-30 13:59:56 -05: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);
|
|
|
|
| -----^^^^^^^---------
|
|
|
|
| | |
|
2020-02-02 10:58:15 -06:00
|
|
|
| | mutable borrow, by `b`, occurs here
|
|
|
|
| immutable borrow, by `a`, occurs here
|
2019-12-14 17:32:20 -06:00
|
|
|
|
2020-02-02 10:58:15 -06:00
|
|
|
error: cannot borrow value as mutable because it is also borrowed as immutable
|
2020-08-30 13:59:56 -05: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);
|
|
|
|
| -----^^^^^^^---------
|
|
|
|
| | |
|
2020-02-02 10:58:15 -06:00
|
|
|
| | mutable borrow, by `b`, occurs here
|
|
|
|
| immutable borrow, by `a`, occurs here
|
2019-12-14 17:32:20 -06:00
|
|
|
|
2020-02-02 10:58:15 -06:00
|
|
|
error: cannot borrow value as mutable because it is also borrowed as immutable
|
2020-08-30 13:59:56 -05: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);
|
|
|
|
| -----^^^^^^^---------
|
|
|
|
| | |
|
2020-02-02 10:58:15 -06:00
|
|
|
| | mutable borrow, by `b`, occurs here
|
|
|
|
| immutable borrow, by `a`, occurs here
|
2019-12-14 17:32:20 -06:00
|
|
|
|
2020-02-02 10:58:15 -06:00
|
|
|
error: cannot borrow value as immutable because it is also borrowed as mutable
|
2020-08-30 13:59:56 -05: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);
|
|
|
|
| ---------^^^^^^^-----
|
|
|
|
| | |
|
2020-02-02 10:58:15 -06:00
|
|
|
| | immutable borrow, by `b`, occurs here
|
|
|
|
| mutable borrow, by `a`, occurs here
|
2019-12-14 17:32:20 -06:00
|
|
|
|
2020-02-02 10:58:15 -06:00
|
|
|
error: cannot borrow value as immutable because it is also borrowed as mutable
|
2020-08-30 13:59:56 -05: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 => {
|
|
|
|
| ---------^^^^^^^-----
|
|
|
|
| | |
|
2020-02-02 10:58:15 -06:00
|
|
|
| | immutable borrow, by `b`, occurs here
|
|
|
|
| mutable borrow, by `a`, occurs here
|
2019-12-14 20:50:55 -06:00
|
|
|
|
2020-02-02 10:58:15 -06:00
|
|
|
error: cannot borrow value as immutable because it is also borrowed as mutable
|
2020-08-30 13:59:56 -05: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>) {
|
|
|
|
| ---------^^^^^^^-----
|
|
|
|
| | |
|
2020-02-02 10:58:15 -06:00
|
|
|
| | immutable borrow, by `b`, occurs here
|
|
|
|
| mutable borrow, by `a`, occurs here
|
2019-12-14 20:50:55 -06:00
|
|
|
|
2019-11-11 04:39:52 -06:00
|
|
|
error[E0382]: use of moved value
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:20:18
|
2019-11-11 04:39:52 -06:00
|
|
|
|
|
|
|
|
LL | let a @ box &b = Box::new(&C);
|
2020-09-02 02:40:56 -05:00
|
|
|
| ---------^ ------------ move occurs because value has type `Box<&C>`, which does not implement the `Copy` trait
|
2019-11-11 04:39:52 -06:00
|
|
|
| | |
|
|
|
|
| | value used here after move
|
|
|
|
| value moved here
|
|
|
|
|
|
|
|
error[E0382]: use of moved value
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:23:17
|
2019-11-11 04:39:52 -06:00
|
|
|
|
|
|
|
|
LL | let a @ box b = Box::new(C);
|
2020-09-02 02:40:56 -05:00
|
|
|
| --------^ ----------- move occurs because value has type `Box<C>`, which does not implement the `Copy` trait
|
2019-11-11 04:39:52 -06:00
|
|
|
| | |
|
|
|
|
| | value used here after move
|
|
|
|
| value moved here
|
|
|
|
|
2019-12-14 20:50:55 -06:00
|
|
|
error[E0382]: use of moved value
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:33:17
|
2019-12-14 20:50:55 -06:00
|
|
|
|
|
2020-01-18 19:47:01 -06:00
|
|
|
LL | match Box::new(C) {
|
2020-09-02 02:40:56 -05:00
|
|
|
| ----------- move occurs because value has type `Box<C>`, which does not implement the `Copy` trait
|
2020-01-18 19:47:01 -06:00
|
|
|
LL | a @ box b => {}
|
|
|
|
| --------^
|
|
|
|
| | |
|
|
|
|
| | value used here after move
|
|
|
|
| value moved here
|
2019-12-14 20:50:55 -06:00
|
|
|
|
2020-03-25 05:17:06 -05:00
|
|
|
error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable
|
2020-08-30 13:59:56 -05: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
|
|
|
|
|
2020-03-25 05:17:06 -05:00
|
|
|
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
|
2020-08-30 13:59:56 -05: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
|
|
|
|
|
2020-03-25 05:17:06 -05:00
|
|
|
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
|
2020-08-30 13:59:56 -05: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
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:26: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
|
2020-09-02 02:40:56 -05:00
|
|
|
| move occurs because value has type `Box<&C>`, which does not implement the `Copy` trait
|
2019-12-14 20:50:55 -06:00
|
|
|
|
|
|
|
error[E0382]: use of moved value
|
2020-08-30 13:59:56 -05:00
|
|
|
--> $DIR/borrowck-pat-at-and-box.rs:29: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
|
2020-09-02 02:40:56 -05:00
|
|
|
| move occurs because value has type `Box<C>`, which does not implement the `Copy` trait
|
2019-12-14 20:50:55 -06:00
|
|
|
|
2020-03-25 05:17:06 -05:00
|
|
|
error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable
|
2020-08-30 13:59:56 -05: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
|
|
|
|
|
2020-01-18 19:47:01 -06:00
|
|
|
error: aborting due to 17 previous errors
|
2019-11-11 04:39:52 -06:00
|
|
|
|
2020-01-18 19:47:01 -06:00
|
|
|
Some errors have detailed explanations: E0382, E0502.
|
|
|
|
For more information about an error, try `rustc --explain E0382`.
|