Skip to content

Commit

Permalink
Add regression test for #105821
Browse files Browse the repository at this point in the history
Signed-off-by: Yuki Okushi <[email protected]>
  • Loading branch information
JohnTitor committed Mar 1, 2023
1 parent bcb610d commit 50d35c1
Showing 1 changed file with 23 additions and 0 deletions.
23 changes: 23 additions & 0 deletions tests/ui/const-generics/issues/issue-105821.rs
Original file line number Diff line number Diff line change
@@ -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() {}

0 comments on commit 50d35c1

Please sign in to comment.