]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const_evaluatable_checked/let-bindings.rs
Auto merge of #79342 - CDirkx:ipaddr-const, r=oli-obk
[rust.git] / src / test / ui / const-generics / const_evaluatable_checked / let-bindings.rs
1 #![feature(const_generics, const_evaluatable_checked)]
2 #![allow(incomplete_features)]
3
4 // We do not yet want to support let-bindings in abstract consts,
5 // so this test should keep failing for now.
6 fn test<const N: usize>() -> [u8; { let x = N; N + 1 }] where [u8; { let x = N; N + 1 }]: Default {
7     //~^ ERROR overly complex generic constant
8     //~| ERROR overly complex generic constant
9     Default::default()
10 }
11
12 fn main() {
13     let x = test::<31>();
14     assert_eq!(x, [0; 32]);
15 }