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

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

355 lines
14 KiB
Plaintext
Raw Normal View History

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 moved into `b` here
| value 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 moved into `e` here
| | value moved into `c` here
| value 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 moved into `c` here
| value 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 moved into `e` here
| value 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 moved into `c` here
| | value moved into `b` here
| value 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 moved into `b` here
| value 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 moved into `e` here
| | value moved into `c` here
| value 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 moved into `c` here
| value 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 moved into `e` here
| value 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 moved into `c` here
| | value moved into `b` here
| value 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 moved into `b` here
| value 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 moved into `e` here
| | value moved into `c` here
| value 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 moved into `c` here
| value 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 moved into `e` here
| value 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 moved into `c` here
| | value moved into `b` here
| value 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 moved into `b` here
| value 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 moved into `e` here
| | value moved into `c` here
| value 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 moved into `c` here
| value 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 moved into `e` here
| value 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 moved into `c` here
| | value moved into `b` here
| value borrowed, by `a`, here
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 moved into `b` here
| value borrowed, by `a`, here
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 moved into `e` here
| | value moved into `c` here
| value 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 moved into `c` here
| value 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 moved into `e` here
| value borrowed, by `d`, here
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 moved into `c` here
| | value moved into `b` here
| value 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
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
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
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
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
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 field 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 field in the pattern to avoid moving the value
|
LL | ref a @ Some((ref b @ mut c, ref d @ ref e)) => {}
| +++
error[E0382]: borrow of moved value
--> $DIR/borrowck-pat-by-move-and-ref.rs:11:11
|
LL | fn f1(ref a @ b: U) {}
2022-09-08 09:44:45 -05:00
| ^^^^^ - value moved here
| |
| value borrowed here after move
| 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: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[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
2020-11-03 00:45:41 -06:00
error: aborting due to 36 previous errors
For more information about this error, try `rustc --explain E0382`.