Move methods from Map to TyCtxt, part 3.
Continuing the work from #137162. Every method gains a `hir_` prefix.
This commit is contained in:
@@ -95,7 +95,7 @@ pub(crate) struct IfLetRescope {
|
||||
}
|
||||
|
||||
fn expr_parent_is_else(tcx: TyCtxt<'_>, hir_id: hir::HirId) -> bool {
|
||||
let Some((_, hir::Node::Expr(expr))) = tcx.hir().parent_iter(hir_id).next() else {
|
||||
let Some((_, hir::Node::Expr(expr))) = tcx.hir_parent_iter(hir_id).next() else {
|
||||
return false;
|
||||
};
|
||||
let hir::ExprKind::If(_cond, _conseq, Some(alt)) = expr.kind else { return false };
|
||||
@@ -103,7 +103,7 @@ fn expr_parent_is_else(tcx: TyCtxt<'_>, hir_id: hir::HirId) -> bool {
|
||||
}
|
||||
|
||||
fn expr_parent_is_stmt(tcx: TyCtxt<'_>, hir_id: hir::HirId) -> bool {
|
||||
let mut parents = tcx.hir().parent_iter(hir_id);
|
||||
let mut parents = tcx.hir_parent_iter(hir_id);
|
||||
let stmt = match parents.next() {
|
||||
Some((_, hir::Node::Stmt(stmt))) => stmt,
|
||||
Some((_, hir::Node::Block(_) | hir::Node::Arm(_))) => return true,
|
||||
|
||||
Reference in New Issue
Block a user