I am trying to implement IntoIterator for a type which needs to yield an immutable reference of it's inner type like so:
impl<T> IntoIterator for Ref<T>
where
for<'a> &'a T: IntoIterator,
{
type Item = T::Item;
type IntoIter = T::IntoIter;
fn into_iter(self) -> Self::IntoIter {
todo!()
}
}
However, the above does not type-check because I declared that &'a T: IntoIterator not T: IntoIterator, and therefore T::Item won't work...how can I name this associated type?