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

112 lines
4.0 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:11: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:15: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:26: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:32: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:34: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:37: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 immutable because it is also borrowed as mutable
--> $DIR/borrowck-pat-at-and-box.rs:43:9
|
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:11: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:15: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
2019-12-14 17:32:20 -06:00
--> $DIR/borrowck-pat-at-and-box.rs:37: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
2019-12-14 17:32:20 -06:00
--> $DIR/borrowck-pat-at-and-box.rs:43: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
2019-12-14 17:32:20 -06:00
error: aborting due to 11 previous errors
Some errors have detailed explanations: E0007, E0009, E0382, E0502.
For more information about an error, try `rustc --explain E0007`.