]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/generic_const_exprs/nested-abstract-consts-1.rs
Move generic error message to separate branches
[rust.git] / src / test / ui / const-generics / generic_const_exprs / nested-abstract-consts-1.rs
1 // run-pass
2 #![feature(generic_const_exprs)]
3 #![allow(incomplete_features)]
4
5 fn callee<const M2: usize>() -> usize
6 where
7     [u8; M2 + 1]: Sized,
8 {
9     M2
10 }
11
12 fn caller<const N1: usize>() -> usize
13 where
14     [u8; N1 + 1]: Sized,
15     [u8; (N1 + 1) + 1]: Sized,
16 {
17     callee::<{ N1 + 1 }>()
18 }
19
20 fn main() {
21     assert_eq!(caller::<4>(), 5);
22 }
23
24 // Test that the ``(N1 + 1) + 1`` bound on ``caller`` satisfies the ``M2 + 1`` bound on ``callee``