// Tests that HRTBs are correctly accepted -- https://github.com/rust-lang/rust/issues/50301 // check-pass trait Trait where for<'a> &'a Self::IntoIter: IntoIterator, { type IntoIter; fn get(&self) -> Self::IntoIter; } struct Impl(Vec); impl Trait for Impl { type IntoIter = ImplIntoIter; fn get(&self) -> Self::IntoIter { ImplIntoIter(self.0.clone()) } } struct ImplIntoIter(Vec); impl<'a> IntoIterator for &'a ImplIntoIter { type Item = ::Item; type IntoIter = std::iter::Cloned>; fn into_iter(self) -> Self::IntoIter { (&self.0).into_iter().cloned() } } fn main() { }