1 // Test that the fake borrows for matches are removed after borrow checking.
7 fn match_guard(x: Option<&&i32>, c: bool) -> i32 {
15 match_guard(None, true);
20 // START rustc.match_guard.CleanFakeReadsAndBorrows.before.mir
22 // FakeRead(ForMatchedPlace, _1);
23 // _3 = discriminant(_1);
24 // switchInt(move _3) -> [1isize: bb5, otherwise: bb2];
39 // switchInt((*(*((_1 as Some).0: &'<empty> &'<empty> i32)))) -> [0i32: bb1, otherwise: bb2];
51 // _5 = &shallow ((_1 as Some).0: &'<empty> &'<empty> i32);
52 // _6 = &shallow (*((_1 as Some).0: &'<empty> &'<empty> i32));
53 // _7 = &shallow (*(*((_1 as Some).0: &'<empty> &'<empty> i32)));
56 // FakeRead(ForMatchGuard, _4);
57 // FakeRead(ForMatchGuard, _5);
58 // FakeRead(ForMatchGuard, _6);
59 // FakeRead(ForMatchGuard, _7);
60 // switchInt(move _8) -> [false: bb4, otherwise: bb7];
69 // END rustc.match_guard.CleanFakeReadsAndBorrows.before.mir
71 // START rustc.match_guard.CleanFakeReadsAndBorrows.after.mir
74 // _3 = discriminant(_1);
75 // switchInt(move _3) -> [1isize: bb5, otherwise: bb2];
90 // switchInt((*(*((_1 as Some).0: &'<empty> &'<empty> i32)))) -> [0i32: bb1, otherwise: bb2];
111 // switchInt(move _8) -> [false: bb4, otherwise: bb7];
120 // END rustc.match_guard.CleanFakeReadsAndBorrows.after.mir