]> git.lizzy.rs Git - rust.git/blob - tests/mir-opt/remove_fake_borrows.rs
Rollup merge of #107769 - compiler-errors:pointer-like, r=eholk
[rust.git] / tests / mir-opt / remove_fake_borrows.rs
1 // Test that the fake borrows for matches are removed after borrow checking.
2
3 // ignore-wasm32-bare compiled with panic=abort by default
4
5 // EMIT_MIR remove_fake_borrows.match_guard.CleanupPostBorrowck.diff
6 fn match_guard(x: Option<&&i32>, c: bool) -> i32 {
7     match x {
8         Some(0) if c => 0,
9         _ => 1,
10     }
11 }
12
13 fn main() {
14     match_guard(None, true);
15 }