rust/tests/ui/pattern/bindings-after-at/borrowck-pat-by-move-and-ref.stderr

351 lines
14 KiB
Plaintext

error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:24:9
|
LL | let ref a @ b = U;
| ^^^^^ - value is moved into `b` here
| |
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:26:9
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (U, U);
| ^^^^^ ----- - value is moved into `e` here
| | |
| | value is moved into `c` here
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:26:18
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (U, U);
| ^^^^^ ----- value is moved into `c` here
| |
| value is borrowed by `b` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:26:33
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (U, U);
| ^^^^^ - value is moved into `e` here
| |
| value is borrowed by `d` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:30:9
|
LL | let ref mut a @ [b, mut c] = [U, U];
| ^^^^^^^^^ - ----- value is moved into `c` here
| | |
| | value is moved into `b` here
| value is mutably borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:33:9
|
LL | let ref a @ b = u();
| ^^^^^ - value is moved into `b` here
| |
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:36:9
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
| ^^^^^ ----- - value is moved into `e` here
| | |
| | value is moved into `c` here
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:36:18
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
| ^^^^^ ----- value is moved into `c` here
| |
| value is borrowed by `b` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:36:33
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
| ^^^^^ - value is moved into `e` here
| |
| value is borrowed by `d` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:42:9
|
LL | let ref mut a @ [b, mut c] = [u(), u()];
| ^^^^^^^^^ - ----- value is moved into `c` here
| | |
| | value is moved into `b` here
| value is mutably borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:47:9
|
LL | ref a @ Some(b) => {}
| ^^^^^ - value is moved into `b` here
| |
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:52:9
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| ^^^^^ ----- - value is moved into `e` here
| | |
| | value is moved into `c` here
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:52:23
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| ^^^^^ ----- value is moved into `c` here
| |
| value is borrowed by `b` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:52:38
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| ^^^^^ - value is moved into `e` here
| |
| value is borrowed by `d` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:59:9
|
LL | ref mut a @ Some([b, mut c]) => {}
| ^^^^^^^^^ - ----- value is moved into `c` here
| | |
| | value is moved into `b` here
| value is mutably borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:64:9
|
LL | ref a @ Some(b) => {}
| ^^^^^ - value is moved into `b` here
| |
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:69:9
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| ^^^^^ ----- - value is moved into `e` here
| | |
| | value is moved into `c` here
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:69:23
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| ^^^^^ ----- value is moved into `c` here
| |
| value is borrowed by `b` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:69:38
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| ^^^^^ - value is moved into `e` here
| |
| value is borrowed by `d` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:78:9
|
LL | ref mut a @ Some([b, mut c]) => {}
| ^^^^^^^^^ - ----- value is moved into `c` here
| | |
| | value is moved into `b` here
| value is mutably borrowed by `a` here
error[E0382]: borrow of partially moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:30:9
|
LL | let ref mut a @ [b, mut c] = [U, U];
| ^^^^^^^^^ ----- value partially moved here
| |
| value borrowed here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
|
LL | let ref mut a @ [b, ref mut c] = [U, U];
| +++
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:33:9
|
LL | let ref a @ b = u();
| ^^^^^ - --- move occurs because value has type `U`, which does not implement the `Copy` trait
| | |
| | value moved here
| value borrowed here after move
|
help: borrow this binding in the pattern to avoid moving the value
|
LL | let ref a @ ref b = u();
| +++
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:36:18
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
| ^^^^^ ----- value moved here
| |
| value borrowed here after move
|
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
|
LL | let ref a @ (ref b @ ref mut c, ref d @ e) = (u(), u());
| +++
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:36:33
|
LL | let ref a @ (ref b @ mut c, ref d @ e) = (u(), u());
| ^^^^^ - value moved here
| |
| value borrowed here after move
|
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
|
LL | let ref a @ (ref b @ mut c, ref d @ ref e) = (u(), u());
| +++
error[E0382]: borrow of partially moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:42:9
|
LL | let ref mut a @ [b, mut c] = [u(), u()];
| ^^^^^^^^^ ----- value partially moved here
| |
| value borrowed here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
|
LL | let ref mut a @ [b, ref mut c] = [u(), u()];
| +++
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:69:23
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| ^^^^^ ----- value moved here
| |
| value borrowed here after move
|
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
|
LL | ref a @ Some((ref b @ ref mut c, ref d @ e)) => {}
| +++
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:69:38
|
LL | ref a @ Some((ref b @ mut c, ref d @ e)) => {}
| ^^^^^ - value moved here
| |
| value borrowed here after move
|
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
help: borrow this binding in the pattern to avoid moving the value
|
LL | ref a @ Some((ref b @ mut c, ref d @ ref e)) => {}
| +++
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:11:11
|
LL | fn f1(ref a @ b: U) {}
| ^^^^^ - value is moved into `b` here
| |
| value is borrowed by `a` here
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:11:11
|
LL | fn f1(ref a @ b: U) {}
| ^^^^^ - value moved here
| |
| value borrowed here after move
| move occurs because value has type `U`, which does not implement the `Copy` trait
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:14:11
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
| ^^^^^ ----- - value is moved into `e` here
| | |
| | value is moved into `c` here
| value is borrowed by `a` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:14:20
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
| ^^^^^ ----- value is moved into `c` here
| |
| value is borrowed by `b` here
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:14:35
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
| ^^^^^ - value is moved into `e` here
| |
| value is borrowed by `d` here
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:14:20
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
| ^^^^^ ----- value moved here
| |
| value borrowed here after move
|
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:14:35
|
LL | fn f2(ref a @ (ref b @ mut c, ref d @ e): (U, U)) {}
| ^^^^^ - value moved here
| |
| value borrowed here after move
|
= note: move occurs because value has type `U`, which does not implement the `Copy` trait
error: cannot move out of value because it is borrowed
--> $DIR/borrowck-pat-by-move-and-ref.rs:20:11
|
LL | fn f3(ref mut a @ [b, mut c]: [U; 2]) {}
| ^^^^^^^^^ - ----- value is moved into `c` here
| | |
| | value is moved into `b` here
| value is mutably borrowed by `a` here
error[E0382]: borrow of partially moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:20:11
|
LL | fn f3(ref mut a @ [b, mut c]: [U; 2]) {}
| ^^^^^^^^^ ----- value partially moved here
| |
| value borrowed here after partial move
|
= note: partial move occurs because value has type `U`, which does not implement the `Copy` trait
error: aborting due to 36 previous errors
For more information about this error, try `rustc --explain E0382`.