mirror of
https://github.com/rust-lang/rust.git
synced 2024-10-30 05:51:58 +00:00
15 lines
304 B
Rust
15 lines
304 B
Rust
//@ run-pass
|
|
|
|
pub fn main() {
|
|
assert!(Some(Box::new(())).is_some());
|
|
|
|
let xs: Box<[()]> = Box::<[(); 0]>::new([]);
|
|
assert!(Some(xs).is_some());
|
|
|
|
struct Foo;
|
|
assert!(Some(Box::new(Foo)).is_some());
|
|
|
|
let ys: Box<[Foo]> = Box::<[Foo; 0]>::new([]);
|
|
assert!(Some(ys).is_some());
|
|
}
|