rust/tests/ui/iterators/issue-28098.rs

Ignoring revisions in .git-blame-ignore-revs. Click here to bypass and see the normal blame view.

28 lines
608 B
Rust
Raw Normal View History

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
}