1 // Test that the fake borrows for matches are removed after borrow checking.
7 fn match_guard(x: Option<&&i32>) -> i32 {
20 // START rustc.match_guard.CleanFakeReadsAndBorrows.before.mir
22 // FakeRead(ForMatchedPlace, _1);
23 // _2 = discriminant(_1);
25 // _4 = &shallow ((_1 as Some).0: &'<empty> &'<empty> i32);
26 // _5 = &shallow (*((_1 as Some).0: &'<empty> &'<empty> i32));
27 // _6 = &shallow (*(*((_1 as Some).0: &'<empty> &'<empty> i32)));
28 // switchInt(move _2) -> [1isize: bb6, otherwise: bb4];
39 // FakeRead(ForMatchGuard, _3);
40 // FakeRead(ForMatchGuard, _4);
41 // FakeRead(ForMatchGuard, _5);
42 // FakeRead(ForMatchGuard, _6);
46 // FakeRead(ForMatchGuard, _3);
47 // FakeRead(ForMatchGuard, _4);
48 // FakeRead(ForMatchGuard, _5);
49 // FakeRead(ForMatchGuard, _6);
56 // switchInt((*(*((_1 as Some).0: &'<empty> &'<empty> i32)))) -> [0i32: bb3, otherwise: bb4];
70 // END rustc.match_guard.CleanFakeReadsAndBorrows.before.mir
72 // START rustc.match_guard.CleanFakeReadsAndBorrows.after.mir
75 // _2 = discriminant(_1);
80 // switchInt(move _2) -> [1isize: bb6, otherwise: bb4];
108 // switchInt((*(*((_1 as Some).0: &'<empty> &'<empty> i32)))) -> [0i32: bb3, otherwise: bb4];
122 // END rustc.match_guard.CleanFakeReadsAndBorrows.after.mir