about summary refs log tree commit diff
path: root/tests/ui/const-generics/generic_const_exprs/issue-97047-ice-1.rs
blob: 443d0a2fe87a2fede1078abf22a5e2bf75906c68 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
//@ check-pass

#![feature(adt_const_params, unsized_const_params, generic_const_exprs)]
//~^ WARN the feature `unsized_const_params` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features]
//~^^ WARN the feature `generic_const_exprs` is incomplete and may not be safe to use and/or cause compiler crashes [incomplete_features]

pub struct Changes<const CHANGES: &'static [&'static str]>
where
    [(); CHANGES.len()]:,
{
    changes: [usize; CHANGES.len()],
}

impl<const CHANGES: &'static [&'static str]> Changes<CHANGES>
where
    [(); CHANGES.len()]:,
{
    pub const fn new() -> Self {
        Self { changes: [0; CHANGES.len()] }
    }
}

pub fn main() {}