//~ ERROR overflow evaluating the requirement ` as Iterator>::Item == ()` //@ build-fail //@ compile-flags: -Zinline-mir=no // Regression test for #91949. // This hanged *forever* on 1.56, fixed by #90423. #![recursion_limit = "256"] struct Wrapped(T); struct IteratorOfWrapped>(I); impl> Iterator for IteratorOfWrapped { type Item = Wrapped; fn next(&mut self) -> Option> { self.0.next().map(Wrapped) } } fn recurse(elements: T) -> Vec //~^ WARN function cannot return without recursing where T: Iterator, { recurse(IteratorOfWrapped(elements).map(|t| t.0)) } fn main() { recurse(std::iter::empty()); }