2021-08-27 11:04:57 -05:00
|
|
|
#![feature(generic_const_exprs)]
|
2020-09-11 03:46:35 -05:00
|
|
|
#![allow(incomplete_features)]
|
|
|
|
|
|
|
|
// We do not yet want to support let-bindings in abstract consts,
|
|
|
|
// so this test should keep failing for now.
|
|
|
|
fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
|
2020-09-21 14:50:00 -05:00
|
|
|
//~^ ERROR overly complex generic constant
|
|
|
|
//~| ERROR overly complex generic constant
|
2020-09-11 03:46:35 -05:00
|
|
|
Default::default()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn main() {
|
|
|
|
let x = test::<31>();
|
|
|
|
assert_eq!(x, [0; 32]);
|
|
|
|
}
|