1 2 3 4 5 6 7 8 9 10 11 12 13 14
struct A { a: Box<i32> } fn foo(n: i32) { let x = A { a: Box::new(n) }; let _y = match x { A { a: v } if { drop(v); true } => v, //~^ ERROR cannot move out of `v` in pattern guard _ => Box::new(0), }; } fn main() { foo(107); }