]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/generic_const_exprs/unused_expr.rs
Rollup merge of #106717 - klensy:typo, r=lcnr
[rust.git] / tests / ui / const-generics / generic_const_exprs / unused_expr.rs
1 #![feature(generic_const_exprs)]
2 #![allow(incomplete_features)]
3
4 fn add<const N: usize>() -> [u8; { N + 1; 5 }] {
5     //~^ ERROR overly complex generic constant
6     todo!()
7 }
8
9 fn div<const N: usize>() -> [u8; { N / 1; 5 }] {
10     //~^ ERROR overly complex generic constant
11     todo!()
12 }
13
14 const fn foo(n: usize) {}
15
16 fn fn_call<const N: usize>() -> [u8; { foo(N); 5 }] {
17     //~^ ERROR overly complex generic constant
18     todo!()
19 }
20
21 fn main() {
22     add::<12>();
23     div::<9>();
24     fn_call::<14>();
25 }