rust/tests/ui/nll/match-guards-always-borrow.stderr

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

24 lines
1.0 KiB
Plaintext
Raw Normal View History

error[E0507]: cannot move out of `foo` in pattern guard
--> $DIR/match-guards-always-borrow.rs:10:14
2018-08-08 07:28:26 -05:00
|
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
|
= 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
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
|
= 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`.