2018-08-30 07:18:55 -05:00
|
|
|
// run-pass
|
2015-03-22 15:13:15 -05:00
|
|
|
// pretty-expanded FIXME #23616
|
|
|
|
|
2015-01-07 19:25:56 -06:00
|
|
|
#![feature(box_syntax)]
|
2014-05-05 20:56:44 -05:00
|
|
|
|
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() {
|
2014-05-05 20:56:44 -05:00
|
|
|
foo(Some(box 22), true);
|
|
|
|
foo(Some(box 22), false);
|
2012-09-12 19:06:36 -05:00
|
|
|
foo(None, true);
|
|
|
|
foo(None, false);
|
2013-02-14 13:47:00 -06:00
|
|
|
}
|