Take a LocalDefId in expect_*item.

This commit is contained in:
Camille GILLOT 2021-10-20 22:38:10 +02:00
parent 3c8b644d0d
commit 56533d9e87
5 changed files with 6 additions and 12 deletions

View file

@ -1939,7 +1939,7 @@ impl<'tcx> LateLintPass<'tcx> for Methods {
return;
}
let name = impl_item.ident.name.as_str();
let parent = cx.tcx.hir().get_parent_item(impl_item.hir_id());
let parent = cx.tcx.hir().get_parent_did(impl_item.hir_id());
let item = cx.tcx.hir().expect_item(parent);
let self_ty = cx.tcx.type_of(item.def_id);