Check for mutable borrow of counter variable
This commit is contained in:
parent
6b57924e81
commit
8a5b4f19fd
2 changed files with 6 additions and 0 deletions
|
|
@ -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 }
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue