Skip to content

Commit

Permalink
Rollup merge of rust-lang#108605 - JohnTitor:issue-105821, r=compiler…
Browse files Browse the repository at this point in the history
…-errors

Add regression test for rust-lang#105821

Closes rust-lang#105821
r? compiler-errors
  • Loading branch information
Dylan-DPC authored Mar 1, 2023
2 parents 0ed76b4 + 50d35c1 commit 02e4eef
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 02e4eef

Please sign in to comment.