2019-07-27 00:54:25 +03:00
|
|
|
// run-pass
|
|
|
|
|
|
2015-01-08 02:25:56 +01:00
|
|
|
#![feature(box_syntax)]
|
2011-09-23 14:58:06 -07:00
|
|
|
|
|
|
|
|
// Tests for if as expressions returning boxed types
|
|
|
|
|
fn test_box() {
|
2015-02-17 21:41:32 +01:00
|
|
|
let rs: Box<_> = if true { box 100 } else { box 101 };
|
2015-01-25 22:05:03 +01:00
|
|
|
assert_eq!(*rs, 100);
|
2011-09-23 14:58:06 -07:00
|
|
|
}
|
|
|
|
|
|
2013-02-01 19:43:17 -08:00
|
|
|
pub fn main() { test_box(); }
|