summaryrefslogtreecommitdiffstats
path: root/src/test/ui/iterators/issue-28098.rs
blob: 62a90d90d12defde59aa800c5c601defe8482b48 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
fn main() {
    let _ = Iterator::next(&mut ());
    //~^ ERROR `()` is not an iterator
    //~| ERROR `()` is not an iterator

    for _ in false {}
    //~^ ERROR `bool` is not an iterator

    let _ = Iterator::next(&mut ());
    //~^ ERROR `()` is not an iterator

    other()
}

pub fn other() {
    // check errors are still reported globally

    let _ = Iterator::next(&mut ());
    //~^ ERROR `()` is not an iterator
    //~| ERROR `()` is not an iterator

    let _ = Iterator::next(&mut ());
    //~^ ERROR `()` is not an iterator

    for _ in false {}
    //~^ ERROR `bool` is not an iterator
}