//@ build-fail //@ compile-flags: -Zinline-mir=no //@ error-pattern: overflow evaluating the requirement ` as Iterator>::Item == ()` //@ error-pattern: function cannot return without recursing //@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash" //@ ignore-compare-mode-next-solver (hangs) // 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 where T: Iterator, { recurse(IteratorOfWrapped(elements).map(|t| t.0)) } fn main() { recurse(std::iter::empty()); }