about summary refs log tree commit diff
path: root/tests/ui/const-generics/issues/issue-105821.rs
blob: 3092893837aad1f9cc0a6b36c068c88d4a5753df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
//@ check-pass
// If this test starts failing because it ICEs due to not being able to convert a `ReErased` to
// something then feel free to just convert this to a known-bug. I'm pretty sure this is still
// a failing test, we just started masking the bug.

#![allow(incomplete_features)]
#![feature(adt_const_params, unsized_const_params, 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() {}