2020-09-10 02:48:02 -05:00
|
|
|
type Arr<const N: usize> = [u8; N - 1];
|
2021-08-27 11:04:57 -05:00
|
|
|
//~^ ERROR generic parameters may not be used in const operations
|
2020-09-10 02:48:02 -05:00
|
|
|
|
|
|
|
fn test<const N: usize>() -> Arr<N> where Arr<N>: Default {
|
|
|
|
Default::default()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = test::<33>();
|
|
|
|
assert_eq!(x, [0; 32]);
|
|
|
|
}
|