summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/generic_arg_infer/dont-use-defaults.rs
blob: 251160a0f5f290a50a85e97e5869442ce0b04bc4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// run-pass
#![feature(generic_arg_infer)]

// test that we dont use defaults to aide in type inference

struct Foo<const N: usize = 2>;
impl<const N: usize> Foo<N> {
    fn make_arr() -> [(); N] {
        [(); N]
    }
}

fn main() {
    let [(), (), ()] = Foo::<_>::make_arr();
}