2019-05-05 06:02:32 -05:00
|
|
|
error[E0507]: cannot move out of `foo` in pattern guard
|
2022-12-21 09:29:35 -06:00
|
|
|
--> $DIR/match-guards-always-borrow.rs:10:14
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
|
LL | (|| { let bar = foo; bar.take() })();
|
2022-03-01 22:30:16 -06:00
|
|
|
| ^^ --- move occurs because `foo` has type `&mut Option<&i32>`, which does not implement the `Copy` trait
|
|
|
|
| |
|
2023-01-14 21:06:44 -06:00
|
|
|
| `foo` is moved here
|
2019-05-05 06:02:32 -05:00
|
|
|
|
|
|
|
|
= note: variables bound in patterns cannot be moved from until after the end of the pattern guard
|
2018-08-08 07:28:26 -05:00
|
|
|
|
2022-12-21 09:29:35 -06:00
|
|
|
error[E0507]: cannot move out of `foo` in pattern guard
|
|
|
|
--> $DIR/match-guards-always-borrow.rs:19:14
|
|
|
|
|
|
|
|
|
LL | (|| { let bar = foo; bar.take() })();
|
|
|
|
| ^^ --- move occurs because `foo` has type `&mut Option<&i32>`, which does not implement the `Copy` trait
|
|
|
|
| |
|
2023-01-14 21:06:44 -06:00
|
|
|
| `foo` is moved here
|
2022-12-21 09:29:35 -06:00
|
|
|
|
|
|
|
|
= note: variables bound in patterns cannot be moved from until after the end of the pattern guard
|
|
|
|
|
|
|
|
error: aborting due to 2 previous errors
|
2018-08-08 07:28:26 -05:00
|
|
|
|
|
|
|
For more information about this error, try `rustc --explain E0507`.
|