blob: b0fcb74764b987b8e3f2fe1160cf4d1d2ee48a9e [file] [log] [blame]
// build-fail
fn main() {
rec(Empty);
}
struct Empty;
impl Iterator for Empty {
type Item = ();
fn next<'a>(&'a mut self) -> core::option::Option<()> {
None
}
}
fn identity<T>(x: T) -> T {
x
}
fn rec<T>(mut it: T)
where
T: Iterator,
{
if () == () {
T::count(it);
} else {
rec(identity(&mut it))
//~^ ERROR reached the recursion limit while instantiating
}
}