#![allow(dead_code, deprecated, unused_variables, unused_mut)] #![feature(hasher_prefixfree_extras)] #![allow(non_local_definitions)] struct MyCollection(Option); impl MyCollection { fn len(&self) -> usize { todo!() } } impl<'a, T> IntoIterator for &'a MyCollection { type Item = T; type IntoIter = std::iter::Empty; fn into_iter(self) -> Self::IntoIter { todo!() } } use std::hash::{Hash, Hasher}; impl Hash for MyCollection { fn hash(&self, state: &mut H) { state.write_length_prefix(self.len()); for elt in self { elt.hash(state); } } } fn main() {}