// check-pass use std::marker::PhantomData; trait Family: Sized { type Item<'a>; fn apply_all(&self, f: F) where F: FamilyItemFn { } } struct Array(PhantomData); impl Family for Array { type Item<'a> = &'a T; } trait FamilyItemFn { fn apply(&self, item: T::Item<'_>); } impl FamilyItemFn for F where T: Family, for<'a> F: Fn(T::Item<'a>) { fn apply(&self, item: T::Item<'_>) { (*self)(item); } } fn process(array: Array) { // Works array.apply_all(|x: &T| { }); // ICE: NoSolution array.apply_all(|x: as Family>::Item<'_>| { }); } fn main() {}