mirror of
https://github.com/rust-lang/rust.git
synced 2024-11-01 23:12:02 +00:00
13 lines
193 B
Rust
13 lines
193 B
Rust
//@ run-pass
|
|
struct Foo<const N: usize, T = [u8; N]>(T);
|
|
|
|
impl<const N: usize> Foo<N> {
|
|
fn new() -> Self {
|
|
Foo([0; N])
|
|
}
|
|
}
|
|
|
|
fn main() {
|
|
assert_eq!(Foo::new().0, [0; 10]);
|
|
}
|