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