rust/tests/ui/const-generics/defaults/const-param-in-ty-defaults.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

13 lines
192 B
Rust
Raw Normal View History

// 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]);
}