Skip to content

Commit 233c8c9

Browse files
committedJan 30, 2024
hir: Remove hir::Map::{owner,expect_owner}
1 parent 7539054 commit 233c8c9

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed
 

Diff for: ‎clippy_lints/src/methods/iter_nth_zero.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ use rustc_span::sym;
1111
use super::ITER_NTH_ZERO;
1212

1313
pub(super) fn check(cx: &LateContext<'_>, expr: &hir::Expr<'_>, recv: &hir::Expr<'_>, arg: &hir::Expr<'_>) {
14-
if let OwnerNode::Item(item) = cx.tcx.hir().owner(cx.tcx.hir().get_parent_item(expr.hir_id))
14+
if let OwnerNode::Item(item) = cx.tcx.hir_owner_node(cx.tcx.hir().get_parent_item(expr.hir_id))
1515
&& let def_id = item.owner_id.to_def_id()
1616
&& is_trait_method(cx, expr, sym::Iterator)
1717
&& let Some(Constant::Int(0)) = constant(cx, cx.typeck_results(), arg)

Diff for: ‎clippy_lints/src/returns.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -183,7 +183,7 @@ impl<'tcx> LateLintPass<'tcx> for Return {
183183
&& let ExprKind::Ret(Some(ret)) = expr.kind
184184
&& let ExprKind::Match(.., MatchSource::TryDesugar(_)) = ret.kind
185185
// Ensure this is not the final stmt, otherwise removing it would cause a compile error
186-
&& let OwnerNode::Item(item) = cx.tcx.hir().owner(cx.tcx.hir().get_parent_item(expr.hir_id))
186+
&& let OwnerNode::Item(item) = cx.tcx.hir_owner_node(cx.tcx.hir().get_parent_item(expr.hir_id))
187187
&& let ItemKind::Fn(_, _, body) = item.kind
188188
&& let block = cx.tcx.hir().body(body).value
189189
&& let ExprKind::Block(block, _) = block.kind

0 commit comments

Comments
 (0)