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[E0007]: cannot bind by-move with sub-bindings --> $DIR/borrowck-pat-at-and-box.rs:21: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:33:25 | LL | match Box::new(C) { a @ box b => {} } | ^^^^^^^^^ 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:37:21 | LL | let ref a @ box b = Box::new(NC); | ------------^ | | | | | by-move pattern here | by-ref pattern here error: cannot borrow `a` as mutable because it is also borrowed as immutable --> $DIR/borrowck-pat-at-and-box.rs:39: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: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 | 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:46: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:52:9 | LL | let ref mut a @ box ref b = Box::new(NC); | ---------^^^^^^^----- | | | | | immutable borrow occurs here | mutable borrow occurs here error: cannot borrow `a` as immutable because it is also borrowed as mutable --> $DIR/borrowck-pat-at-and-box.rs:66:9 | LL | ref mut a @ box ref b => { | ---------^^^^^^^----- | | | | | immutable borrow occurs here | mutable borrow occurs here error[E0009]: cannot bind by-move and by-ref in the same pattern --> $DIR/borrowck-pat-at-and-box.rs:75:38 | 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 --> $DIR/borrowck-pat-at-and-box.rs:81:46 | 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 error[E0007]: cannot bind by-move with sub-bindings --> $DIR/borrowck-pat-at-and-box.rs:25:11 | 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 --> $DIR/borrowck-pat-at-and-box.rs:29:11 | LL | fn f2(a @ box b: Box) {} | ^^^^^^^^^ binds an already bound by-move value by moving it error: cannot borrow `a` as immutable because it is also borrowed as mutable --> $DIR/borrowck-pat-at-and-box.rs:58:11 | LL | fn f5(ref mut a @ box ref b: Box) { | ---------^^^^^^^----- | | | | | immutable borrow occurs here | mutable borrow occurs here error[E0382]: use of moved value --> $DIR/borrowck-pat-at-and-box.rs:17: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:21:17 | LL | let a @ box b = Box::new(C); | --------^ ----------- move occurs because value has type `std::boxed::Box`, 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:33:33 | 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`, which does not implement the `Copy` trait error[E0502]: cannot borrow `_` as mutable because it is also borrowed as immutable --> $DIR/borrowck-pat-at-and-box.rs:46: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:52:25 | LL | let ref mut a @ box ref b = Box::new(NC); | ----------------^^^^^ | | | | | immutable borrow occurs here | mutable borrow occurs here ... LL | *a = Box::new(NC); | -- mutable borrow later used here error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable --> $DIR/borrowck-pat-at-and-box.rs:66:25 | 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 --> $DIR/borrowck-pat-at-and-box.rs:25:20 | 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 --> $DIR/borrowck-pat-at-and-box.rs:29:19 | LL | fn f2(a @ box b: Box) {} | --------^ | | | | | value used here after move | value moved here | move occurs because value has type `std::boxed::Box`, which does not implement the `Copy` trait error[E0502]: cannot borrow `_` as immutable because it is also borrowed as mutable --> $DIR/borrowck-pat-at-and-box.rs:58:27 | LL | fn f5(ref mut a @ box ref b: Box) { | ----------------^^^^^ | | | | | immutable borrow occurs here | mutable borrow occurs here ... LL | *a = Box::new(NC); | -- mutable borrow later used here error: aborting due to 24 previous errors Some errors have detailed explanations: E0007, E0009, E0382, E0502. For more information about an error, try `rustc --explain E0007`.