1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
// check-pass // this used to cause stack overflows trait Hrtb<'a> { type Assoc; } impl<'a> Hrtb<'a> for () { type Assoc = (); } impl<'a> Hrtb<'a> for &'a () { type Assoc = (); } fn make_impl() -> impl for<'a> Hrtb<'a, Assoc = impl Send + 'a> {} fn main() {}