]> git.lizzy.rs Git - rust.git/blob - src/test/ui/rfc-0107-bind-by-move-pattern-guards/rfc-reject-double-move-in-first-arm.rs
Update tests for changes to cannot move errors
[rust.git] / src / test / ui / rfc-0107-bind-by-move-pattern-guards / rfc-reject-double-move-in-first-arm.rs
1 #![feature(nll)]
2 #![feature(bind_by_move_pattern_guards)]
3
4 struct A { a: Box<i32> }
5
6 fn foo(n: i32) {
7     let x = A { a: Box::new(n) };
8     let _y = match x {
9         A { a: v } if { drop(v); true } => v,
10         //~^ ERROR cannot move out of `v` in pattern guard
11         _ => Box::new(0),
12     };
13 }
14
15 fn main() {
16     foo(107);
17 }