Sisu
E0035

for over something that is not an array or a range

Error

Built from the repository at commit a8614dc.

for takes an array, or a range such as 0..n.

Why

A for visits one element after another. A single number or a bool has no elements to visit.

Broken

fn main() {
    for n in 5 {
        print(n)
    }
}

What sisu says

error[E0035]: `for` needs an array or a range; this is `i64`
 --> E0035.sisu:2:14
  |
2 |     for n in 5 {
  |              ^

sisu: 1 error
sisu: for more on a code, run `sisu explain <code>`: E0035

Fixed

fn main() {
    for n in 0..5 {
        print(n)
    }
}