]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/issue-61522-array-len-succ.rs
Auto merge of #79342 - CDirkx:ipaddr-const, r=oli-obk
[rust.git] / src / test / ui / const-generics / issue-61522-array-len-succ.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 pub struct MyArray<const COUNT: usize>([u8; COUNT + 1]);
8 //[full]~^ ERROR constant expression depends on a generic parameter
9 //[min]~^^ ERROR generic parameters may not be used
10
11 impl<const COUNT: usize> MyArray<COUNT> {
12     fn inner(&self) -> &[u8; COUNT + 1] {
13         //[full]~^ ERROR constant expression depends on a generic parameter
14         //[min]~^^ ERROR generic parameters may not be used
15         &self.0
16     }
17 }
18
19 fn main() {}