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