1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
// Checks that the impl trait can have its own generics. use impl_trait::impl_trait; struct Foo<T>(T); trait Bar<U> { } impl_trait! { impl<T> Foo<T> { impl trait<U> Bar<U> { } } } fn static_assert_1<T: Bar<U>, U>(_t: T, _u: U) {} fn main() { static_assert_1(Foo(()), ()); }