]> git.lizzy.rs Git - rust.git/blob - src/test/ui/const-generics/const_evaluatable_checked/nested-abstract-consts-1.rs
Auto merge of #86155 - alexcrichton:abort-on-unwind, r=nikomatsakis
[rust.git] / src / test / ui / const-generics / const_evaluatable_checked / nested-abstract-consts-1.rs
1 // run-pass
2 #![feature(const_generics, const_evaluatable_checked)]
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``