2025-08-29 10:53:45 +08:00
|
|
|
//@ build-fail
|
2024-03-30 00:21:25 +01:00
|
|
|
//@ compile-flags: -Copt-level=0
|
|
|
|
|
fn main() {
|
|
|
|
|
rec(&mut None::<()>.into_iter());
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
fn rec<T: Iterator>(mut it: T) {
|
|
|
|
|
if true {
|
|
|
|
|
it.next();
|
|
|
|
|
} else {
|
|
|
|
|
rec(&mut it);
|
2025-08-29 10:53:45 +08:00
|
|
|
//~^ ERROR: reached the recursion limit while instantiating
|
2024-03-30 00:21:25 +01:00
|
|
|
}
|
|
|
|
|
}
|