Fix hang in vec_init_then_push
This commit is contained in:
parent
7babd1b099
commit
15859323ea
3 changed files with 15 additions and 2 deletions
|
|
@ -86,7 +86,7 @@ impl VecPushSearcher {
|
|||
},
|
||||
ExprKind::Unary(UnOp::Deref, _) | ExprKind::Index(..) if !needs_mut => {
|
||||
let mut last_place = parent;
|
||||
while let Some(parent) = get_parent_expr(cx, parent) {
|
||||
while let Some(parent) = get_parent_expr(cx, last_place) {
|
||||
if matches!(parent.kind, ExprKind::Unary(UnOp::Deref, _) | ExprKind::Field(..))
|
||||
|| matches!(parent.kind, ExprKind::Index(e, _) if e.hir_id == last_place.hir_id)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue