2018-08-30 12:18:55 +00:00
|
|
|
//@ run-pass
|
2015-03-22 20:13:15 +00:00
|
|
|
//@ pretty-expanded FIXME #23616
|
|
|
|
|
2015-03-26 00:06:52 +00:00
|
|
|
fn foo(x: Option<Box<isize>>, b: bool) -> isize {
|
2012-09-13 00:06:36 +00:00
|
|
|
match x {
|
|
|
|
None => { 1 }
|
2013-03-15 22:27:15 +00:00
|
|
|
Some(ref x) if b => { *x.clone() }
|
2012-09-13 00:06:36 +00:00
|
|
|
Some(_) => { 0 }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2013-02-02 03:43:17 +00:00
|
|
|
pub fn main() {
|
2021-08-25 00:39:40 +00:00
|
|
|
foo(Some(Box::new(22)), true);
|
|
|
|
foo(Some(Box::new(22)), false);
|
2012-09-13 00:06:36 +00:00
|
|
|
foo(None, true);
|
|
|
|
foo(None, false);
|
2013-02-14 19:47:00 +00:00
|
|
|
}
|