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