rust-lang/rust — pull request #17101 by pcwalton (2014-09-08 17:51:23+00:00)
Title: librustc: Make sure lifetimes in `for` loop heads outlive the `for` loop

itself.

This breaks code like:

for &x in my_vector.iter() {
my_vector[2] = "wibble";
...
}

Change this code to not invalidate iterators. For example:

for i in range(0, my_vector.len()) {
my_vector[2] = "wibble";
...
}

The `for-loop-does-not-borrow-iterators` test for #8372 was incorrect
and has been removed.

Closes #16820.

[breaking-change]

r? @pnkfelix