]> git.lizzy.rs Git - rust.git/blob - tests/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.stderr
Rollup merge of #107576 - P1n3appl3:master, r=tmandry
[rust.git] / tests / ui / rfc-0107-bind-by-move-pattern-guards / rfc-reject-double-move-in-first-arm.stderr
1 error[E0507]: cannot move out of `v` in pattern guard
2   --> $DIR/rfc-reject-double-move-in-first-arm.rs:8:30
3    |
4 LL |         A { a: v } if { drop(v); true } => v,
5    |                              ^ move occurs because `v` has type `Box<i32>`, which does not implement the `Copy` trait
6    |
7    = note: variables bound in patterns cannot be moved from until after the end of the pattern guard
8
9 error[E0507]: cannot move out of `v` in pattern guard
10   --> $DIR/rfc-reject-double-move-in-first-arm.rs:17:45
11    |
12 LL |         A { a: v } if let Some(()) = { drop(v); Some(()) } => v,
13    |                                             ^ move occurs because `v` has type `Box<i32>`, which does not implement the `Copy` trait
14    |
15    = note: variables bound in patterns cannot be moved from until after the end of the pattern guard
16
17 error: aborting due to 2 previous errors
18
19 For more information about this error, try `rustc --explain E0507`.