// check-pass #![feature(generic_const_exprs)] #![allow(incomplete_features)] pub trait Trait{ type R; fn func(self)->Self::R; } pub struct TraitImpl(pub i32); impl Trait for TraitImpl where [();N/2]:, { type R = Self; fn func(self)->Self::R { self } } fn sample(p:P,f:Convert) -> i32 where P:Trait,Convert:Fn(P::R)->i32 { f(p.func()) } fn main() { let t = TraitImpl::<10>(4); sample(t,|x|x.0); }