Check for mutable borrow of counter variable

This commit is contained in:
Nathan Weston 2015-09-10 08:33:29 -04:00
parent 6b57924e81
commit 8a5b4f19fd
2 changed files with 6 additions and 0 deletions

View file

@ -179,4 +179,8 @@ fn main() {
let mut _index = 1;
if false { _index = 0 };
for _v in &vec { _index += 1 }
let mut _index = 0;
{ let mut _x = &mut _index; }
for _v in &vec { _index += 1 }
}