summaryrefslogtreecommitdiffstats
path: root/tests/ui/const-generics/nested-type.rs
blob: 5240f5c3b0b64b8d4cc3919b3cd167ecdfb3ce15 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
// revisions: full min

#![cfg_attr(full, feature(adt_const_params))]
#![cfg_attr(full, allow(incomplete_features))]

struct Foo<const N: [u8; { //[min]~ ERROR `[u8; _]` is forbidden
    struct Foo<const N: usize>;

    impl<const N: usize> Foo<N> {
        fn value() -> usize {
            N
        }
    }

    Foo::<17>::value()
    //~^ ERROR cannot call non-const fn
}]>;

fn main() {}