Skip to content

Commit 02e4eef

Browse files
authored
Rollup merge of #108605 - JohnTitor:issue-105821, r=compiler-errors
Add regression test for #105821 Closes #105821 r? compiler-errors
2 parents 0ed76b4 + 50d35c1 commit 02e4eef

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
// check-pass
2+
3+
#![allow(incomplete_features)]
4+
#![feature(adt_const_params, const_ptr_read, 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() {}

0 commit comments

Comments
 (0)