]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/nested-type.rs
Rollup merge of #78988 - alexcrichton:one-more-intrinsic, r=sfackler
[rust.git] / src / test / ui / const-generics / nested-type.rs
1 // revisions: full min
2
3 #![cfg_attr(full, feature(const_generics))]
4 #![cfg_attr(full, allow(incomplete_features))]
5 #![cfg_attr(min, feature(min_const_generics))]
6
7 struct Foo<const N: [u8; { //[min]~ ERROR `[u8; _]` is forbidden
8     struct Foo<const N: usize>;
9
10     impl<const N: usize> Foo<N> {
11         fn value() -> usize {
12             N
13         }
14     }
15
16     Foo::<17>::value()
17     //~^ ERROR calls in constants are limited to constant functions
18 }]>;
19
20 fn main() {}