1 // Issue 27282: Example 2: 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 mutably borrowed match input) within a
6 // This example is not rejected by AST borrowck (and then reliably
7 // reaches the panic code when executed, despite the compiler warning
8 // about that match arm being unreachable.
13 //~^ ERROR use of moved value: `b` [E0382]
15 _ if { (|| { let bar = b; *bar = false; })();
17 &mut true => { println!("You might think we should get here"); },
18 _ => panic!("surely we could never get here, since rustc warns it is unreachable."),