]> git.lizzy.rs Git - rust.git/blob - src/test/ui/binding/match-value-binding-in-guard-3291.rs
Auto merge of #99612 - yanchen4791:issue-95079-fix, r=compiler-errors
[rust.git] / src / test / ui / binding / match-value-binding-in-guard-3291.rs
1 // run-pass
2 // pretty-expanded FIXME #23616
3
4 fn foo(x: Option<Box<isize>>, b: bool) -> isize {
5     match x {
6       None => { 1 }
7       Some(ref x) if b => { *x.clone() }
8       Some(_) => { 0 }
9     }
10 }
11
12 pub fn main() {
13     foo(Some(Box::new(22)), true);
14     foo(Some(Box::new(22)), false);
15     foo(None, true);
16     foo(None, false);
17 }