]> git.proxmox.com Git - rustc.git/blob - tests/ui/const-generics/issues/issue-105821.rs
New upstream version 1.71.1+dfsg1
[rustc.git] / tests / ui / const-generics / issues / issue-105821.rs
1 // check-pass
2
3 #![allow(incomplete_features)]
4 #![feature(adt_const_params, generic_const_exprs)]
5 #![allow(dead_code)]
6
7 const fn catone<const M: usize>(_a: &[u8; M]) -> [u8; M + 1]
8 where
9 [(); M + 1]:,
10 {
11 unimplemented!()
12 }
13
14 struct Catter<const A: &'static [u8]>;
15 impl<const A: &'static [u8]> Catter<A>
16 where
17 [(); A.len() + 1]:,
18 {
19 const ZEROS: &'static [u8; A.len()] = &[0_u8; A.len()];
20 const R: &'static [u8] = &catone(Self::ZEROS);
21 }
22
23 fn main() {}