]> git.lizzy.rs Git - rust.git/blob - src/test/ui/issues/issue-28098.rs
Merge commit '2ca58e7dda4a9eb142599638c59dc04d15961175' into clippyup
[rust.git] / src / test / ui / issues / issue-28098.rs
1 fn main() {
2     let _ = Iterator::next(&mut ());
3     //~^ ERROR `()` is not an iterator
4     //~| ERROR `()` is not an iterator
5
6     for _ in false {}
7     //~^ ERROR `bool` is not an iterator
8
9     let _ = Iterator::next(&mut ());
10     //~^ ERROR `()` is not an iterator
11
12     other()
13 }
14
15 pub fn other() {
16     // check errors are still reported globally
17
18     let _ = Iterator::next(&mut ());
19     //~^ ERROR `()` is not an iterator
20     //~| ERROR `()` is not an iterator
21
22     let _ = Iterator::next(&mut ());
23     //~^ ERROR `()` is not an iterator
24
25     for _ in false {}
26     //~^ ERROR `bool` is not an iterator
27 }