Rollup merge of #108605 - JohnTitor:issue-105821, r=compiler-errors

Add regression test for #105821

Closes #105821
r? compiler-errors
This commit is contained in:
Dylan DPC 2023-03-01 23:40:22 +05:30 committed by GitHub
commit 02e4eefd88
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -0,0 +1,23 @@
// check-pass
#![allow(incomplete_features)]
#![feature(adt_const_params, const_ptr_read, generic_const_exprs)]
#![allow(dead_code)]
const fn catone<const M: usize>(_a: &[u8; M]) -> [u8; M + 1]
where
[(); M + 1]:,
{
unimplemented!()
}
struct Catter<const A: &'static [u8]>;
impl<const A: &'static [u8]> Catter<A>
where
[(); A.len() + 1]:,
{
const ZEROS: &'static [u8; A.len()] = &[0_u8; A.len()];
const R: &'static [u8] = &catone(Self::ZEROS);
}
fn main() {}