2020-02-28 21:56:37 -06:00
|
|
|
error[E0382]: use of moved value: `m`
|
|
|
|
--> $DIR/issue-53114-borrow-checks.rs:22:11
|
|
|
|
|
|
|
|
|
LL | let m = M;
|
|
|
|
| - move occurs because `m` has type `M`, which does not implement the `Copy` trait
|
|
|
|
LL | drop(m);
|
|
|
|
| - value moved here
|
|
|
|
LL | match m { _ => { } } // #53114: should eventually be accepted too
|
|
|
|
| ^ value used here after move
|
|
|
|
|
2020-08-08 12:16:43 -05:00
|
|
|
error[E0382]: use of partially moved value: `mm`
|
2020-02-28 21:56:37 -06:00
|
|
|
--> $DIR/issue-53114-borrow-checks.rs:27:11
|
|
|
|
|
|
|
|
|
LL | match mm { (_x, _) => { } }
|
2020-08-08 12:16:43 -05:00
|
|
|
| -- value partially moved here
|
2020-02-28 21:56:37 -06:00
|
|
|
LL | match mm { (_, _y) => { } }
|
|
|
|
| ^^ value used here after partial move
|
|
|
|
|
|
2020-08-08 12:16:43 -05:00
|
|
|
= note: partial move occurs because `mm.0` has type `M`, which does not implement the `Copy` trait
|
2022-11-02 23:22:24 -05:00
|
|
|
help: borrow this binding in the pattern to avoid moving the value
|
|
|
|
|
|
|
|
|
LL | match mm { (ref _x, _) => { } }
|
|
|
|
| +++
|
2020-02-28 21:56:37 -06:00
|
|
|
|
2020-08-08 12:16:43 -05:00
|
|
|
error[E0382]: use of partially moved value: `mm`
|
2020-02-28 21:56:37 -06:00
|
|
|
--> $DIR/issue-53114-borrow-checks.rs:29:11
|
|
|
|
|
|
|
|
|
LL | match mm { (_, _y) => { } }
|
2020-08-08 12:16:43 -05:00
|
|
|
| -- value partially moved here
|
2020-02-28 21:56:37 -06:00
|
|
|
LL |
|
|
|
|
LL | match mm { (_, _) => { } }
|
|
|
|
| ^^ value used here after partial move
|
|
|
|
|
|
2020-08-08 12:16:43 -05:00
|
|
|
= note: partial move occurs because `mm.1` has type `M`, which does not implement the `Copy` trait
|
2022-11-02 23:22:24 -05:00
|
|
|
help: borrow this binding in the pattern to avoid moving the value
|
|
|
|
|
|
|
|
|
LL | match mm { (_, ref _y) => { } }
|
|
|
|
| +++
|
2020-02-28 21:56:37 -06:00
|
|
|
|
2020-03-05 13:06:40 -06:00
|
|
|
error[E0382]: use of moved value: `m`
|
|
|
|
--> $DIR/issue-53114-borrow-checks.rs:36:16
|
|
|
|
|
|
2020-04-10 11:22:24 -05:00
|
|
|
LL | let m = M;
|
2020-03-05 13:06:40 -06:00
|
|
|
| - move occurs because `m` has type `M`, which does not implement the `Copy` trait
|
2020-04-10 11:22:24 -05:00
|
|
|
LL | drop(m);
|
2020-03-05 13:06:40 -06:00
|
|
|
| - value moved here
|
2020-04-10 11:22:24 -05:00
|
|
|
LL | if let _ = m { } // #53114: should eventually be accepted too
|
2020-03-05 13:06:40 -06:00
|
|
|
| ^ value used here after move
|
|
|
|
|
2020-08-08 12:16:43 -05:00
|
|
|
error[E0382]: use of partially moved value: `mm`
|
2020-03-05 13:06:40 -06:00
|
|
|
--> $DIR/issue-53114-borrow-checks.rs:41:22
|
|
|
|
|
|
2020-04-10 11:22:24 -05:00
|
|
|
LL | if let (_x, _) = mm { }
|
2020-08-08 12:16:43 -05:00
|
|
|
| -- value partially moved here
|
2020-04-10 11:22:24 -05:00
|
|
|
LL | if let (_, _y) = mm { }
|
2020-03-05 13:06:40 -06:00
|
|
|
| ^^ value used here after partial move
|
|
|
|
|
|
2020-08-08 12:16:43 -05:00
|
|
|
= note: partial move occurs because `mm.0` has type `M`, which does not implement the `Copy` trait
|
2022-11-02 23:22:24 -05:00
|
|
|
help: borrow this binding in the pattern to avoid moving the value
|
|
|
|
|
|
|
|
|
LL | if let (ref _x, _) = mm { }
|
|
|
|
| +++
|
2020-03-05 13:06:40 -06:00
|
|
|
|
2020-08-08 12:16:43 -05:00
|
|
|
error[E0382]: use of partially moved value: `mm`
|
2020-03-05 13:06:40 -06:00
|
|
|
--> $DIR/issue-53114-borrow-checks.rs:43:21
|
|
|
|
|
|
2020-04-10 11:22:24 -05:00
|
|
|
LL | if let (_, _y) = mm { }
|
2020-08-08 12:16:43 -05:00
|
|
|
| -- value partially moved here
|
2020-04-10 11:22:24 -05:00
|
|
|
LL |
|
|
|
|
LL | if let (_, _) = mm { }
|
2020-03-05 13:06:40 -06:00
|
|
|
| ^^ value used here after partial move
|
|
|
|
|
|
2020-08-08 12:16:43 -05:00
|
|
|
= note: partial move occurs because `mm.1` has type `M`, which does not implement the `Copy` trait
|
2022-11-02 23:22:24 -05:00
|
|
|
help: borrow this binding in the pattern to avoid moving the value
|
|
|
|
|
|
|
|
|
LL | if let (_, ref _y) = mm { }
|
|
|
|
| +++
|
2020-03-05 13:06:40 -06:00
|
|
|
|
|
|
|
error: aborting due to 6 previous errors
|
2020-02-28 21:56:37 -06:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0382`.
|