2 #![feature(const_evaluatable_checked, const_generics)]
3 #![allow(incomplete_features)]
5 struct Generic<const K: u64>;
7 struct ConstU64<const K: u64>;
9 impl<const K: u64> Generic<K>
11 ConstU64<{ K - 1 }>: ,
18 impl<const K: u64> Generic<K>
20 ConstU64<{ K - 1 }>: ,
21 ConstU64<{ K + 1 }>: ,
22 ConstU64<{ K + 1 - 1 }>: ,
25 let x: Generic<{ K + 1 }> = Generic;
31 assert_eq!((Generic::<10>).bar(), 11);
34 // Test that the ``ConstU64<{ K + 1 - 1}>`` bound on ``bar``'s impl block satisfies the
35 // ``ConstU64<{K - 1}>`` bound on ``foo``'s impl block