1 // Test that the fake borrows for matches are removed after borrow checking.
5 fn match_guard(x: Option<&&i32>, c: bool) -> i32 {
13 match_guard(None, true);
18 // START rustc.match_guard.CleanupNonCodegenStatements.before.mir
20 // FakeRead(ForMatchedPlace, _1);
21 // _3 = discriminant(_1);
22 // switchInt(move _3) -> [1isize: bb5, otherwise: bb2];
37 // switchInt((*(*((_1 as Some).0: &'<empty> &'<empty> i32)))) -> [0i32: bb1, otherwise: bb2];
45 // _5 = &shallow ((_1 as Some).0: &'<empty> &'<empty> i32);
46 // _6 = &shallow (*((_1 as Some).0: &'<empty> &'<empty> i32));
47 // _7 = &shallow (*(*((_1 as Some).0: &'<empty> &'<empty> i32)));
50 // FakeRead(ForMatchGuard, _4);
51 // FakeRead(ForMatchGuard, _5);
52 // FakeRead(ForMatchGuard, _6);
53 // FakeRead(ForMatchGuard, _7);
54 // switchInt(move _8) -> [false: bb4, otherwise: bb6];
67 // END rustc.match_guard.CleanupNonCodegenStatements.before.mir
69 // START rustc.match_guard.CleanupNonCodegenStatements.after.mir
72 // _3 = discriminant(_1);
73 // switchInt(move _3) -> [1isize: bb5, otherwise: bb2];
88 // switchInt((*(*((_1 as Some).0: &'<empty> &'<empty> i32)))) -> [0i32: bb1, otherwise: bb2];
105 // switchInt(move _8) -> [false: bb4, otherwise: bb6];
118 // END rustc.match_guard.CleanupNonCodegenStatements.after.mir