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