1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
//@ check-pass #![feature(const_trait_impl)] #[const_trait] trait A where Self::Assoc: const B { type Assoc; } #[const_trait] trait B {} fn needs_b<T: const B>() {} fn test<T: A>() { needs_b::<T::Assoc>(); } fn main() {}