2019-07-26 16:54:25 -05:00
|
|
|
//@ run-pass
|
|
|
|
|
2014-04-02 16:23:52 -05:00
|
|
|
pub fn main() {
|
2015-02-15 02:52:21 -06:00
|
|
|
assert!(Some(Box::new(())).is_some());
|
2014-04-02 16:23:52 -05:00
|
|
|
|
2015-02-15 02:52:21 -06:00
|
|
|
let xs: Box<[()]> = Box::<[(); 0]>::new([]);
|
2014-09-08 18:27:06 -05:00
|
|
|
assert!(Some(xs).is_some());
|
|
|
|
|
2014-04-02 16:23:52 -05:00
|
|
|
struct Foo;
|
2015-02-15 02:52:21 -06:00
|
|
|
assert!(Some(Box::new(Foo)).is_some());
|
2014-09-08 18:27:06 -05:00
|
|
|
|
2015-02-15 02:52:21 -06:00
|
|
|
let ys: Box<[Foo]> = Box::<[Foo; 0]>::new([]);
|
2014-09-08 18:27:06 -05:00
|
|
|
assert!(Some(ys).is_some());
|
2014-04-02 16:23:52 -05:00
|
|
|
}
|