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