]> git.proxmox.com Git - rustc.git/blob - src/test/ui/const-generics/infer_arg_from_pat.rs
Merge branch 'debian/experimental' into debian/sid
[rustc.git] / src / test / ui / const-generics / infer_arg_from_pat.rs
1 // run-pass
2 //
3 // see issue #70529
4 #![feature(const_generics)]
5 //~^ WARN the feature `const_generics` is incomplete
6
7 struct A<const N: usize> {
8 arr: [u8; N],
9 }
10
11 impl<const N: usize> A<N> {
12 fn new() -> Self {
13 A {
14 arr: [0; N],
15 }
16 }
17
18 fn value(&self) -> usize {
19 N
20 }
21 }
22
23 fn main() {
24 let a = A::new();
25 let [_, _] = a.arr;
26 assert_eq!(a.value(), 2);
27 }