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