Auto merge of #7018 - Y-Nak:same_item_push, r=Manishearth
Don't trigger `same_item_push` if the vec is used in the loop body fixes #6987 changelog: `same_item_push`: Don't trigger if the `vec` is used in the loop body
This commit is contained in:
commit
57406c93df
2 changed files with 91 additions and 53 deletions
|
|
@ -148,4 +148,11 @@ fn main() {
|
|||
};
|
||||
vec.push(item);
|
||||
}
|
||||
|
||||
// Fix #6987
|
||||
let mut vec = Vec::new();
|
||||
for _ in 0..10 {
|
||||
vec.push(1);
|
||||
vec.extend(&[2]);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue