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: bb3, otherwise: bb2];
32 // switchInt((*(*((_1 as Some).0: &'<empty> &'<empty> i32)))) -> [0i32: bb1, otherwise: bb2];
36 // _5 = &shallow ((_1 as Some).0: &'<empty> &'<empty> i32);
37 // _6 = &shallow (*((_1 as Some).0: &'<empty> &'<empty> i32));
38 // _7 = &shallow (*(*((_1 as Some).0: &'<empty> &'<empty> i32)));
41 // FakeRead(ForMatchGuard, _4);
42 // FakeRead(ForMatchGuard, _5);
43 // FakeRead(ForMatchGuard, _6);
44 // FakeRead(ForMatchGuard, _7);
45 // switchInt(move _8) -> [false: bb6, otherwise: bb5];
62 // END rustc.match_guard.CleanupNonCodegenStatements.before.mir
64 // START rustc.match_guard.CleanupNonCodegenStatements.after.mir
67 // _3 = discriminant(_1);
68 // switchInt(move _3) -> [1isize: bb3, otherwise: bb2];
78 // switchInt((*(*((_1 as Some).0: &'<empty> &'<empty> i32)))) -> [0i32: bb1, otherwise: bb2];
91 // switchInt(move _8) -> [false: bb6, otherwise: bb5];
108 // END rustc.match_guard.CleanupNonCodegenStatements.after.mir