]> git.lizzy.rs Git - rust.git/blob - tests/ui/const-generics/fn_with_two_const_inputs.rs
Auto merge of #106908 - cjgillot:copyprop-ssa, r=oli-obk
[rust.git] / tests / ui / const-generics / fn_with_two_const_inputs.rs
1 #![feature(generic_const_exprs)]
2 #![allow(incomplete_features)]
3
4 const fn both(_: usize, b: usize) -> usize {
5     b
6 }
7
8 fn foo<const N: usize, const M: usize>() -> [(); N + 2]
9 where
10     [(); both(N + 1, M + 1)]:,
11 {
12     bar()
13     //~^ ERROR: unconstrained generic constant
14 }
15
16 fn bar<const N: usize>() -> [(); N]
17 where
18     [(); N + 1]:,
19 {
20     [(); N]
21 }
22
23 fn main() {}