]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/defaults/const-param-in-ty-defaults.rs
Rollup merge of #106709 - khuey:disable_split_dwarf_inlining_by_default, r=davidtwco
[rust.git] / tests / ui / const-generics / defaults / const-param-in-ty-defaults.rs
1 // run-pass
2 struct Foo<const N: usize, T = [u8; N]>(T);
3
4 impl<const N: usize> Foo<N> {
5     fn new() -> Self {
6         Foo([0; N])
7     }
8 }
9
10 fn main() {
11     assert_eq!(Foo::new().0, [0; 10]);
12 }