migrate from `for` to `foreach` or `do`

There are still 17 `for` loops left in `librustc` so I set the lint to `warn` there instead of `deny`. I'll be chipping away at them though so expect some amends to the commit.