1 // Issue 27282: Example 1: This sidesteps the AST checks disallowing
2 // mutable borrows in match guards by hiding the mutable borrow in a
3 // guard behind a move (of the ref mut pattern id) within a closure.
9 if { (|| { let bar = foo; bar.take() })(); false } => {},
10 //~^ ERROR cannot move out of `foo` in pattern guard [E0507]
11 Some(s) => std::process::exit(*s),