]> git.lizzy.rs Git - rust.git/blob - src/test/mir-opt/remove_fake_borrows.rs
Rollup merge of #100277 - m-ou-se:format-args-1, r=compiler-errors
[rust.git] / src / test / 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.CleanupNonCodegenStatements.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 }