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

@ -2069,14 +2069,11 @@ impl<'tcx> CheckAttrVisitor<'tcx> {
span: Span,
target: Target,
) -> bool {
let hir = self.tcx.hir();
if let Target::ForeignFn = target
&& let Some(parent) = hir.opt_parent_id(hir_id)
&& let hir::Node::Item(Item {
kind: ItemKind::ForeignMod { abi: Abi::RustIntrinsic | Abi::PlatformIntrinsic, .. },
..
}) = self.tcx.hir_node(parent)
}) = self.tcx.parent_hir_node(hir_id)
{
return true;
}