1
Fork 0

hir: Remove hir::Map::{opt_parent_id,parent_id,get_parent,find_parent}

This commit is contained in:
Vadim Petrochenkov 2024-02-09 23:58:36 +03:00
parent e46e3e7107
commit b07283815b
78 changed files with 233 additions and 318 deletions

View file

@ -1416,8 +1416,7 @@ impl<'tcx> LateLintPass<'tcx> for UnreachablePub {
}
fn check_field_def(&mut self, cx: &LateContext<'_>, field: &hir::FieldDef<'_>) {
let map = cx.tcx.hir();
if matches!(map.get_parent(field.hir_id), Node::Variant(_)) {
if matches!(cx.tcx.parent_hir_node(field.hir_id), Node::Variant(_)) {
return;
}
self.perform_lint(cx, "field", field.def_id, field.vis_span, false);