1
Fork 0

Rollup merge of #89078 - camsteffen:map-ref, r=cjgillot

Cleanup: Remove needless reference in ParentHirIterator

It forces an intermediate binding of `Map` which is a Copy type.
This commit is contained in:
the8472 2021-09-21 22:54:00 +02:00 committed by GitHub
commit 9f50c87267
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 15 additions and 22 deletions

View file

@ -522,8 +522,7 @@ fn item_for(tcx: TyCtxt<'_>, local_def_id: LocalDefId) -> LocalDefId {
_ => {}
}
let item = {
let hir = tcx.hir();
let mut parent_iter = hir.parent_iter(hir_id);
let mut parent_iter = tcx.hir().parent_iter(hir_id);
loop {
let node = parent_iter.next().map(|n| n.1);
match node {