error: cannot move out of value because it is borrowed --> $DIR/borrowck-pat-at-and-box.rs:32:9 | LL | let ref a @ box b = Box::new(NC); | -----^^^^^^^- | | | | | value moved into `b` here | value borrowed, by `a`, here error: cannot borrow value as mutable because it is also borrowed as immutable --> $DIR/borrowck-pat-at-and-box.rs:35:9 | LL | let ref a @ box ref mut b = Box::new(nc()); | -----^^^^^^^--------- | | | | | mutable borrow, by `b`, occurs here | immutable borrow, by `a`, occurs here error: cannot borrow value 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, by `b`, occurs here | immutable borrow, by `a`, occurs here error: cannot borrow value 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, by `b`, occurs here | immutable borrow, by `a`, occurs here error: cannot borrow value 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, by `b`, occurs here | immutable borrow, by `a`, occurs here error: cannot borrow value as immutable because it is also borrowed as mutable --> $DIR/borrowck-pat-at-and-box.rs:49:9 | LL | let ref mut a @ box ref b = Box::new(NC); | ---------^^^^^^^----- | | | | | immutable borrow, by `b`, occurs here | mutable borrow, by `a`, occurs here error: cannot borrow value as immutable because it is also borrowed as mutable --> $DIR/borrowck-pat-at-and-box.rs:63:9 | LL | ref mut a @ box ref b => { | ---------^^^^^^^----- | | | | | immutable borrow, by `b`, occurs here | mutable borrow, by `a`, occurs here error: cannot borrow value as immutable because it is also borrowed as mutable --> $DIR/borrowck-pat-at-and-box.rs:55:11 | LL | fn f5(ref mut a @ box ref b: Box) { | ---------^^^^^^^----- | | | | | immutable borrow, by `b`, occurs here | mutable borrow, by `a`, occurs here error[E0382]: borrow of moved value --> $DIR/borrowck-pat-at-and-box.rs:32:9 | LL | let ref a @ box b = Box::new(NC); | ^^^^^^^^^^^^- | | | | | value moved here | value borrowed here after move | = note: move occurs because value has type `NC`, which does not implement the `Copy` trait error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable --> $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 ... LL | *b = NC; | ------- mutable borrow later used here error[E0502]: cannot borrow value as immutable because it is also borrowed as mutable --> $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 ... LL | *b = NC; | ------- mutable borrow later used here error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable --> $DIR/borrowck-pat-at-and-box.rs:49:9 | LL | let ref mut a @ box ref b = Box::new(NC); | ^^^^^^^^^^^^^^^^----- | | | | | immutable borrow occurs here | mutable borrow occurs here ... LL | drop(b); | - immutable borrow later used here error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable --> $DIR/borrowck-pat-at-and-box.rs:63:9 | LL | ref mut a @ box ref b => { | ^^^^^^^^^^^^^^^^----- | | | | | immutable borrow occurs here | mutable borrow occurs here ... LL | drop(b); | - immutable borrow later used here error[E0502]: cannot borrow value as mutable because it is also borrowed as immutable --> $DIR/borrowck-pat-at-and-box.rs:55:11 | LL | fn f5(ref mut a @ box ref b: Box) { | ^^^^^^^^^^^^^^^^----- | | | | | immutable borrow occurs here | mutable borrow occurs here ... LL | drop(b); | - immutable borrow later used here error: aborting due to 14 previous errors Some errors have detailed explanations: E0382, E0502. For more information about an error, try `rustc --explain E0382`.