1 // Test that we have enough false edges to avoid exposing the exact matching
2 // algorithm in borrow checking.
4 fn guard_always_precedes_arm(y: i32) {
6 // x should always be initialized, as the only way to reach the arm is
9 0 | 2 if { x = 2; true } => x,
14 fn guard_may_be_skipped(y: i32) {
16 // Even though x *is* always initialized, we don't want to have borrowck
17 // results be based on whether patterns are exhaustive.
19 _ if { x = 2; true } => 1,
28 fn guard_may_be_taken(y: bool) {
29 let x = String::new();
30 // Even though x *is* never moved before the use, we don't want to have
31 // borrowck results be based on whether patterns are disjoint.
33 false if { drop(x); true } => 1,
35 x; //~ ERROR use of moved value: `x`