]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-67552.rs
98192dae20da878fe90dfe2e086a1aae324f37b6
[rust.git] / src / test / ui / issues / issue-67552.rs
1 // build-fail
2 // normalize-stderr-test: ".nll/" -> "/"
3
4 fn main() {
5     rec(Empty);
6 }
7
8 struct Empty;
9
10 impl Iterator for Empty {
11     type Item = ();
12     fn next<'a>(&'a mut self) -> core::option::Option<()> {
13         None
14     }
15 }
16
17 fn identity<T>(x: T) -> T {
18     x
19 }
20
21 fn rec<T>(mut it: T)
22 where
23     T: Iterator,
24 {
25     if () == () {
26         T::count(it);
27     } else {
28         rec(identity(&mut it))
29         //~^ ERROR reached the recursion limit while instantiating
30     }
31 }