get_parent and find_parent
This commit is contained in:
parent
6af339dbfa
commit
b1b19bd851
29 changed files with 88 additions and 95 deletions
|
@ -1526,7 +1526,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(map.parent_id(field.hir_id)), Node::Variant(_)) {
|
||||
if matches!(map.get_parent(field.hir_id), Node::Variant(_)) {
|
||||
return;
|
||||
}
|
||||
self.perform_lint(cx, "field", field.def_id, field.vis_span, false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue