get_parent_node_by_hir_id -> get_parent_node

This commit is contained in:
Manish Goregaokar
2019-06-25 14:33:51 -07:00
parent f0edfab44c
commit c47a7e4ef2
12 changed files with 17 additions and 17 deletions

View File

@@ -169,7 +169,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCopyConst {
fn check_impl_item(&mut self, cx: &LateContext<'a, 'tcx>, impl_item: &'tcx ImplItem) {
if let ImplItemKind::Const(hir_ty, ..) = &impl_item.node {
let item_hir_id = cx.tcx.hir().get_parent_node_by_hir_id(impl_item.hir_id);
let item_hir_id = cx.tcx.hir().get_parent_node(impl_item.hir_id);
let item = cx.tcx.hir().expect_item(item_hir_id);
// Ensure the impl is an inherent impl.
if let ItemKind::Impl(_, _, _, _, None, _, _) = item.node {
@@ -204,7 +204,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for NonCopyConst {
let mut dereferenced_expr = expr;
let mut needs_check_adjustment = true;
loop {
let parent_id = cx.tcx.hir().get_parent_node_by_hir_id(cur_expr.hir_id);
let parent_id = cx.tcx.hir().get_parent_node(cur_expr.hir_id);
if parent_id == cur_expr.hir_id {
break;
}