rust/src/test/ui/pattern/bindings-after-at/borrowck-pat-at-and-box.stderr

121 lines
4.3 KiB
Plaintext
Raw Normal View History

warning: the feature `bindings_after_at` is incomplete and may cause the compiler to crash
--> $DIR/borrowck-pat-at-and-box.rs:3:12
|
LL | #![feature(bindings_after_at)]
| ^^^^^^^^^^^^^^^^^
|
= note: `#[warn(incomplete_features)]` on by default
error[E0007]: cannot bind by-move with sub-bindings
--> $DIR/borrowck-pat-at-and-box.rs:13:9
|
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
--> $DIR/borrowck-pat-at-and-box.rs:17:9
|
LL | let a @ box b = Box::new(C);
| ^^^^^^^^^ binds an already bound by-move value by moving it
error[E0009]: cannot bind by-move and by-ref in the same pattern
--> $DIR/borrowck-pat-at-and-box.rs:35:21
|
LL | let ref a @ box b = Box::new(NC);
| ------------^
| | |
| | by-move pattern here
| by-ref pattern here
2019-12-14 17:32:20 -06:00
error: cannot borrow `a` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-at-and-box.rs:41:9
|
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
--> $DIR/borrowck-pat-at-and-box.rs:43: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
--> $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 mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-at-and-box.rs:48: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
--> $DIR/borrowck-pat-at-and-box.rs:54: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
error[E0382]: use of moved value
--> $DIR/borrowck-pat-at-and-box.rs:13:18
|
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
--> $DIR/borrowck-pat-at-and-box.rs:17:17
|
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[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable
--> $DIR/borrowck-pat-at-and-box.rs:48:21
|
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
--> $DIR/borrowck-pat-at-and-box.rs:54:25
|
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
...
LL | *a = Box::new(NC);
| -- mutable borrow later used here
error: aborting due to 12 previous errors
Some errors have detailed explanations: E0007, E0009, E0382, E0502.
For more information about an error, try `rustc --explain E0007`.