Skip to content

Commit a313ef0

Browse files
rename get_parent_node to parent_id
1 parent c757267 commit a313ef0

File tree

48 files changed

+119
-121
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

48 files changed

+119
-121
lines changed

compiler/rustc_borrowck/src/diagnostics/conflict_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@ impl<'cx, 'tcx> MirBorrowckCtxt<'cx, 'tcx> {
394394
}
395395
}
396396
let typeck = self.infcx.tcx.typeck(self.mir_def_id());
397-
let hir_id = hir.get_parent_node(expr.hir_id);
397+
let hir_id = hir.parent_id(expr.hir_id);
398398
if let Some(parent) = hir.find(hir_id) {
399399
let (def_id, args, offset) = if let hir::Node::Expr(parent_expr) = parent
400400
&& let hir::ExprKind::MethodCall(_, _, args, _) = parent_expr.kind

compiler/rustc_borrowck/src/diagnostics/mutability_errors.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1004,7 +1004,7 @@ impl<'a, 'tcx> MirBorrowckCtxt<'a, 'tcx> {
10041004
let hir = self.infcx.tcx.hir();
10051005
let closure_id = self.mir_hir_id();
10061006
let closure_span = self.infcx.tcx.def_span(self.mir_def_id());
1007-
let fn_call_id = hir.get_parent_node(closure_id);
1007+
let fn_call_id = hir.parent_id(closure_id);
10081008
let node = hir.get(fn_call_id);
10091009
let def_id = hir.enclosing_body_owner(fn_call_id);
10101010
let mut look_at_return = true;

compiler/rustc_hir/src/hir.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -3460,7 +3460,7 @@ impl<'hir> Node<'hir> {
34603460
/// ```ignore (illustrative)
34613461
/// ctor
34623462
/// .ctor_hir_id()
3463-
/// .and_then(|ctor_id| tcx.hir().find(tcx.hir().get_parent_node(ctor_id)))
3463+
/// .and_then(|ctor_id| tcx.hir().find(tcx.hir().parent_id(ctor_id)))
34643464
/// .and_then(|parent| parent.ident())
34653465
/// ```
34663466
pub fn ident(&self) -> Option<Ident> {

compiler/rustc_hir_analysis/src/astconv/mod.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -2936,7 +2936,7 @@ impl<'o, 'tcx> dyn AstConv<'tcx> + 'o {
29362936
let hir::Node::ImplItem(hir::ImplItem { kind: hir::ImplItemKind::Fn(..), ident, .. }) =
29372937
hir.get(fn_hir_id) else { return None };
29382938
let hir::Node::Item(hir::Item { kind: hir::ItemKind::Impl(i), .. }) =
2939-
hir.get(hir.get_parent_node(fn_hir_id)) else { bug!("ImplItem should have Impl parent") };
2939+
hir.get(hir.parent_id(fn_hir_id)) else { bug!("ImplItem should have Impl parent") };
29402940

29412941
let trait_ref = self.instantiate_mono_trait_ref(
29422942
i.of_trait.as_ref()?,

compiler/rustc_hir_analysis/src/collect.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ pub(crate) fn placeholder_type_error_diag<'tcx>(
212212
is_fn = true;
213213

214214
// Check if parent is const or static
215-
let parent_id = tcx.hir().get_parent_node(hir_ty.hir_id);
215+
let parent_id = tcx.hir().parent_id(hir_ty.hir_id);
216216
let parent_node = tcx.hir().get(parent_id);
217217

218218
is_const_or_static = matches!(
@@ -1108,7 +1108,7 @@ fn fn_sig(tcx: TyCtxt<'_>, def_id: DefId) -> ty::PolyFnSig<'_> {
11081108
ImplItem(hir::ImplItem { kind: ImplItemKind::Fn(sig, _), generics, .. }) => {
11091109
// Do not try to infer the return type for a impl method coming from a trait
11101110
if let Item(hir::Item { kind: ItemKind::Impl(i), .. }) =
1111-
tcx.hir().get(tcx.hir().get_parent_node(hir_id))
1111+
tcx.hir().get(tcx.hir().parent_id(hir_id))
11121112
&& i.of_trait.is_some()
11131113
{
11141114
<dyn AstConv<'_>>::ty_of_fn(

compiler/rustc_hir_analysis/src/collect/generics_of.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
103103
// `min_const_generics`.
104104
Some(parent_def_id.to_def_id())
105105
} else {
106-
let parent_node = tcx.hir().get(tcx.hir().get_parent_node(hir_id));
106+
let parent_node = tcx.hir().get(tcx.hir().parent_id(hir_id));
107107
match parent_node {
108108
// HACK(eddyb) this provides the correct generics for repeat
109109
// expressions' count (i.e. `N` in `[x; N]`), and explicit
@@ -320,7 +320,7 @@ pub(super) fn generics_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::Generics {
320320

321321
// provide junk type parameter defs for const blocks.
322322
if let Node::AnonConst(_) = node {
323-
let parent_node = tcx.hir().get(tcx.hir().get_parent_node(hir_id));
323+
let parent_node = tcx.hir().get(tcx.hir().parent_id(hir_id));
324324
if let Node::Expr(&Expr { kind: ExprKind::ConstBlock(_), .. }) = parent_node {
325325
params.push(ty::GenericParamDef {
326326
index: next_index(),

compiler/rustc_hir_analysis/src/collect/lifetimes.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -682,7 +682,7 @@ impl<'a, 'tcx> Visitor<'tcx> for LifetimeContext<'a, 'tcx> {
682682
};
683683
let hir_id = self.tcx.hir().local_def_id_to_hir_id(def_id);
684684
// Ensure that the parent of the def is an item, not HRTB
685-
let parent_id = self.tcx.hir().get_parent_node(hir_id);
685+
let parent_id = self.tcx.hir().parent_id(hir_id);
686686
if !parent_id.is_owner() {
687687
struct_span_err!(
688688
self.tcx.sess,

compiler/rustc_hir_analysis/src/collect/predicates_of.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,7 @@ fn gather_explicit_predicates_of(tcx: TyCtxt<'_>, def_id: DefId) -> ty::GenericP
270270
// We create bi-directional Outlives predicates between the original
271271
// and the duplicated parameter, to ensure that they do not get out of sync.
272272
if let Node::Item(&Item { kind: ItemKind::OpaqueTy(..), .. }) = node {
273-
let opaque_ty_id = tcx.hir().get_parent_node(hir_id);
273+
let opaque_ty_id = tcx.hir().parent_id(hir_id);
274274
let opaque_ty_node = tcx.hir().get(opaque_ty_id);
275275
let Node::Ty(&Ty { kind: TyKind::OpaqueDef(_, lifetimes, _), .. }) = opaque_ty_node else {
276276
bug!("unexpected {opaque_ty_node:?}")

compiler/rustc_hir_analysis/src/collect/type_of.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ pub(super) fn opt_const_param_of(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Option<
2828
_ => return None,
2929
};
3030

31-
let parent_node_id = tcx.hir().get_parent_node(hir_id);
31+
let parent_node_id = tcx.hir().parent_id(hir_id);
3232
let parent_node = tcx.hir().get(parent_node_id);
3333

3434
let (generics, arg_idx) = match parent_node {
@@ -402,7 +402,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
402402
}
403403

404404
Node::AnonConst(_) => {
405-
let parent_node = tcx.hir().get(tcx.hir().get_parent_node(hir_id));
405+
let parent_node = tcx.hir().get(tcx.hir().parent_id(hir_id));
406406
match parent_node {
407407
Node::Ty(&Ty { kind: TyKind::Array(_, ref constant), .. })
408408
| Node::Expr(&Expr { kind: ExprKind::Repeat(_, ref constant), .. })
@@ -445,7 +445,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
445445
..
446446
},
447447
) if let Node::TraitRef(trait_ref) =
448-
tcx.hir().get(tcx.hir().get_parent_node(binding_id))
448+
tcx.hir().get(tcx.hir().parent_id(binding_id))
449449
&& e.hir_id == hir_id =>
450450
{
451451
let Some(trait_def_id) = trait_ref.trait_def_id() else {
@@ -472,7 +472,7 @@ pub(super) fn type_of(tcx: TyCtxt<'_>, def_id: DefId) -> Ty<'_> {
472472
Node::TypeBinding(
473473
binding @ &TypeBinding { hir_id: binding_id, gen_args, ref kind, .. },
474474
) if let Node::TraitRef(trait_ref) =
475-
tcx.hir().get(tcx.hir().get_parent_node(binding_id))
475+
tcx.hir().get(tcx.hir().parent_id(binding_id))
476476
&& let Some((idx, _)) =
477477
gen_args.args.iter().enumerate().find(|(_, arg)| {
478478
if let GenericArg::Const(ct) = arg {

compiler/rustc_hir_typeck/src/_match.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -289,15 +289,15 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
289289

290290
fn maybe_get_coercion_reason(&self, hir_id: hir::HirId, sp: Span) -> Option<(Span, String)> {
291291
let node = {
292-
let rslt = self.tcx.hir().get_parent_node(self.tcx.hir().get_parent_node(hir_id));
292+
let rslt = self.tcx.hir().parent_id(self.tcx.hir().parent_id(hir_id));
293293
self.tcx.hir().get(rslt)
294294
};
295295
if let hir::Node::Block(block) = node {
296296
// check that the body's parent is an fn
297297
let parent = self
298298
.tcx
299299
.hir()
300-
.get(self.tcx.hir().get_parent_node(self.tcx.hir().get_parent_node(block.hir_id)));
300+
.get(self.tcx.hir().parent_id(self.tcx.hir().parent_id(block.hir_id)));
301301
if let (Some(expr), hir::Node::Item(hir::Item { kind: hir::ItemKind::Fn(..), .. })) =
302302
(&block.expr, parent)
303303
{

compiler/rustc_hir_typeck/src/callee.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -288,7 +288,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
288288
callee_span: Span,
289289
) {
290290
let hir = self.tcx.hir();
291-
let parent_hir_id = hir.get_parent_node(hir_id);
291+
let parent_hir_id = hir.parent_id(hir_id);
292292
let parent_node = hir.get(parent_hir_id);
293293
if let (
294294
hir::Node::Expr(hir::Expr {
@@ -303,7 +303,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
303303
{
304304
// Actually need to unwrap a few more layers of HIR to get to
305305
// the _real_ closure...
306-
let async_closure = hir.get_parent_node(hir.get_parent_node(parent_hir_id));
306+
let async_closure = hir.parent_id(hir.parent_id(parent_hir_id));
307307
if let hir::Node::Expr(hir::Expr {
308308
kind: hir::ExprKind::Closure(&hir::Closure { fn_decl_span, .. }),
309309
..
@@ -336,7 +336,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
336336
call_expr: &'tcx hir::Expr<'tcx>,
337337
callee_expr: &'tcx hir::Expr<'tcx>,
338338
) -> bool {
339-
let hir_id = self.tcx.hir().get_parent_node(call_expr.hir_id);
339+
let hir_id = self.tcx.hir().parent_id(call_expr.hir_id);
340340
let parent_node = self.tcx.hir().get(hir_id);
341341
if let (
342342
hir::Node::Expr(hir::Expr { kind: hir::ExprKind::Array(_), .. }),

compiler/rustc_hir_typeck/src/coercion.rs

+3-3
Original file line numberDiff line numberDiff line change
@@ -1547,7 +1547,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
15471547
err.span_label(cause.span, "return type is not `()`");
15481548
}
15491549
ObligationCauseCode::BlockTailExpression(blk_id) => {
1550-
let parent_id = fcx.tcx.hir().get_parent_node(blk_id);
1550+
let parent_id = fcx.tcx.hir().parent_id(blk_id);
15511551
err = self.report_return_mismatched_types(
15521552
cause,
15531553
expected,
@@ -1578,7 +1578,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
15781578
None,
15791579
);
15801580
if !fcx.tcx.features().unsized_locals {
1581-
let id = fcx.tcx.hir().get_parent_node(id);
1581+
let id = fcx.tcx.hir().parent_id(id);
15821582
unsized_return = self.is_return_ty_unsized(fcx, id);
15831583
}
15841584
}
@@ -1668,7 +1668,7 @@ impl<'tcx, 'exprs, E: AsCoercionSite> CoerceMany<'tcx, 'exprs, E> {
16681668
let mut pointing_at_return_type = false;
16691669
let mut fn_output = None;
16701670

1671-
let parent_id = fcx.tcx.hir().get_parent_node(id);
1671+
let parent_id = fcx.tcx.hir().parent_id(id);
16721672
let parent = fcx.tcx.hir().get(parent_id);
16731673
if let Some(expr) = expression
16741674
&& let hir::Node::Expr(hir::Expr { kind: hir::ExprKind::Closure(&hir::Closure { body, .. }), .. }) = parent

compiler/rustc_hir_typeck/src/demand.rs

+12-12
Original file line numberDiff line numberDiff line change
@@ -211,7 +211,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
211211
expr: &hir::Expr<'_>,
212212
error: Option<TypeError<'tcx>>,
213213
) {
214-
let parent = self.tcx.hir().get_parent_node(expr.hir_id);
214+
let parent = self.tcx.hir().parent_id(expr.hir_id);
215215
match (self.tcx.hir().find(parent), error) {
216216
(Some(hir::Node::Local(hir::Local { ty: Some(ty), init: Some(init), .. })), _)
217217
if init.hir_id == expr.hir_id =>
@@ -258,7 +258,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
258258
hir::Path { res: hir::def::Res::Local(hir_id), .. },
259259
)) => {
260260
if let Some(hir::Node::Pat(pat)) = self.tcx.hir().find(*hir_id) {
261-
let parent = self.tcx.hir().get_parent_node(pat.hir_id);
261+
let parent = self.tcx.hir().parent_id(pat.hir_id);
262262
primary_span = pat.span;
263263
secondary_span = pat.span;
264264
match self.tcx.hir().find(parent) {
@@ -326,7 +326,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
326326
expr: &hir::Expr<'_>,
327327
error: Option<TypeError<'tcx>>,
328328
) {
329-
let parent = self.tcx.hir().get_parent_node(expr.hir_id);
329+
let parent = self.tcx.hir().parent_id(expr.hir_id);
330330
let Some(TypeError::Sorts(ExpectedFound { expected, .. })) = error else {return;};
331331
let Some(hir::Node::Expr(hir::Expr {
332332
kind: hir::ExprKind::Assign(lhs, rhs, _), ..
@@ -510,7 +510,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
510510

511511
// Unroll desugaring, to make sure this works for `for` loops etc.
512512
loop {
513-
parent = self.tcx.hir().get_parent_node(id);
513+
parent = self.tcx.hir().parent_id(id);
514514
if let Some(parent_span) = self.tcx.hir().opt_span(parent) {
515515
if parent_span.find_ancestor_inside(expr.span).is_some() {
516516
// The parent node is part of the same span, so is the result of the
@@ -790,12 +790,12 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
790790
return None;
791791
};
792792

793-
let local_parent = self.tcx.hir().get_parent_node(local_id);
793+
let local_parent = self.tcx.hir().parent_id(local_id);
794794
let Some(Node::Param(hir::Param { hir_id: param_hir_id, .. })) = self.tcx.hir().find(local_parent) else {
795795
return None;
796796
};
797797

798-
let param_parent = self.tcx.hir().get_parent_node(*param_hir_id);
798+
let param_parent = self.tcx.hir().parent_id(*param_hir_id);
799799
let Some(Node::Expr(hir::Expr {
800800
hir_id: expr_hir_id,
801801
kind: hir::ExprKind::Closure(hir::Closure { fn_decl: closure_fn_decl, .. }),
@@ -804,7 +804,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
804804
return None;
805805
};
806806

807-
let expr_parent = self.tcx.hir().get_parent_node(*expr_hir_id);
807+
let expr_parent = self.tcx.hir().parent_id(*expr_hir_id);
808808
let hir = self.tcx.hir().find(expr_parent);
809809
let closure_params_len = closure_fn_decl.inputs.len();
810810
let (
@@ -857,7 +857,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
857857
_ => None,
858858
}?;
859859

860-
match hir.find(hir.get_parent_node(expr.hir_id))? {
860+
match hir.find(hir.parent_id(expr.hir_id))? {
861861
Node::ExprField(field) => {
862862
if field.ident.name == local.name && field.is_shorthand {
863863
return Some(local.name);
@@ -883,7 +883,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
883883
/// Returns whether the given expression is an `else if`.
884884
pub(crate) fn is_else_if_block(&self, expr: &hir::Expr<'_>) -> bool {
885885
if let hir::ExprKind::If(..) = expr.kind {
886-
let parent_id = self.tcx.hir().get_parent_node(expr.hir_id);
886+
let parent_id = self.tcx.hir().parent_id(expr.hir_id);
887887
if let Some(Node::Expr(hir::Expr {
888888
kind: hir::ExprKind::If(_, _, Some(else_expr)),
889889
..
@@ -1040,7 +1040,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10401040
if let Some(hir::Node::Expr(hir::Expr {
10411041
kind: hir::ExprKind::Assign(..),
10421042
..
1043-
})) = self.tcx.hir().find(self.tcx.hir().get_parent_node(expr.hir_id))
1043+
})) = self.tcx.hir().find(self.tcx.hir().parent_id(expr.hir_id))
10441044
{
10451045
if mutability.is_mut() {
10461046
// Suppressing this diagnostic, we'll properly print it in `check_expr_assign`
@@ -1268,7 +1268,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
12681268
let mut sugg = vec![];
12691269

12701270
if let Some(hir::Node::ExprField(field)) =
1271-
self.tcx.hir().find(self.tcx.hir().get_parent_node(expr.hir_id))
1271+
self.tcx.hir().find(self.tcx.hir().parent_id(expr.hir_id))
12721272
{
12731273
// `expr` is a literal field for a struct, only suggest if appropriate
12741274
if field.is_shorthand {
@@ -1625,7 +1625,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
16251625
[start, end],
16261626
_,
16271627
) = expr.kind else { return; };
1628-
let parent = self.tcx.hir().get_parent_node(expr.hir_id);
1628+
let parent = self.tcx.hir().parent_id(expr.hir_id);
16291629
if let Some(hir::Node::ExprField(_)) = self.tcx.hir().find(parent) {
16301630
// Ignore `Foo { field: a..Default::default() }`
16311631
return;

compiler/rustc_hir_typeck/src/expr.rs

+4-4
Original file line numberDiff line numberDiff line change
@@ -920,7 +920,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
920920
original_expr_id: HirId,
921921
then: impl FnOnce(&hir::Expr<'_>),
922922
) {
923-
let mut parent = self.tcx.hir().get_parent_node(original_expr_id);
923+
let mut parent = self.tcx.hir().parent_id(original_expr_id);
924924
while let Some(node) = self.tcx.hir().find(parent) {
925925
match node {
926926
hir::Node::Expr(hir::Expr {
@@ -959,7 +959,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
959959
| hir::Node::TraitItem(_)
960960
| hir::Node::Crate(_) => break,
961961
_ => {
962-
parent = self.tcx.hir().get_parent_node(parent);
962+
parent = self.tcx.hir().parent_id(parent);
963963
}
964964
}
965965
}
@@ -1083,7 +1083,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
10831083
// Do not suggest `if let x = y` as `==` is way more likely to be the intention.
10841084
let hir = self.tcx.hir();
10851085
if let hir::Node::Expr(hir::Expr { kind: ExprKind::If { .. }, .. }) =
1086-
hir.get(hir.get_parent_node(hir.get_parent_node(expr.hir_id)))
1086+
hir.get(hir.parent_id(hir.parent_id(expr.hir_id)))
10871087
{
10881088
err.span_suggestion_verbose(
10891089
expr.span.shrink_to_lo(),
@@ -2462,7 +2462,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
24622462
err.span_label(field.span, "method, not a field");
24632463
let expr_is_call =
24642464
if let hir::Node::Expr(hir::Expr { kind: ExprKind::Call(callee, _args), .. }) =
2465-
self.tcx.hir().get(self.tcx.hir().get_parent_node(expr.hir_id))
2465+
self.tcx.hir().get(self.tcx.hir().parent_id(expr.hir_id))
24662466
{
24672467
expr.hir_id == callee.hir_id
24682468
} else {

compiler/rustc_hir_typeck/src/fn_ctxt/_impl.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1436,7 +1436,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
14361436
let mut contained_in_place = false;
14371437

14381438
while let hir::Node::Expr(parent_expr) =
1439-
self.tcx.hir().get(self.tcx.hir().get_parent_node(expr_id))
1439+
self.tcx.hir().get(self.tcx.hir().parent_id(expr_id))
14401440
{
14411441
match &parent_expr.kind {
14421442
hir::ExprKind::Assign(lhs, ..) | hir::ExprKind::AssignOp(_, lhs, ..) => {

compiler/rustc_hir_typeck/src/fn_ctxt/checks.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1803,7 +1803,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
18031803
hir_id: call_hir_id,
18041804
span: call_span,
18051805
..
1806-
}) = hir.get(hir.get_parent_node(expr.hir_id))
1806+
}) = hir.get(hir.parent_id(expr.hir_id))
18071807
&& callee.hir_id == expr.hir_id
18081808
{
18091809
if self.closure_span_overlaps_error(error, *call_span) {

compiler/rustc_hir_typeck/src/fn_ctxt/suggestions.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
3232
self.typeck_results
3333
.borrow()
3434
.liberated_fn_sigs()
35-
.get(self.tcx.hir().get_parent_node(self.body_id))
35+
.get(self.tcx.hir().parent_id(self.body_id))
3636
.copied()
3737
}
3838

@@ -642,7 +642,7 @@ impl<'a, 'tcx> FnCtxt<'a, 'tcx> {
642642
// Check if the parent expression is a call to Pin::new. If it
643643
// is and we were expecting a Box, ergo Pin<Box<expected>>, we
644644
// can suggest Box::pin.
645-
let parent = self.tcx.hir().get_parent_node(expr.hir_id);
645+
let parent = self.tcx.hir().parent_id(expr.hir_id);
646646
let Some(Node::Expr(Expr { kind: ExprKind::Call(fn_name, _), .. })) = self.tcx.hir().find(parent) else {
647647
return false;
648648
};

0 commit comments

Comments
 (0)