rust/tests/ui/recursion/issue-83150.rs
2024-07-02 15:48:48 -04:00

16 lines
403 B
Rust

//@ build-fail
//@ compile-flags: -Copt-level=0
//@ normalize-stderr-test: "long-type-\d+" -> "long-type-hash"
//@ ignore-compare-mode-next-solver (hangs)
fn main() {
let mut iter = 0u8..1;
func(&mut iter)
}
fn func<T: Iterator<Item = u8>>(iter: &mut T) {
//~^ WARN function cannot return without recursing
func(&mut iter.map(|x| x + 1))
//~^ ERROR reached the type-length limit
}