diff options
| author | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-01-25 20:47:03 +0300 |
|---|---|---|
| committer | Vadim Petrochenkov <vadim.petrochenkov@gmail.com> | 2024-01-30 15:00:52 +0300 |
| commit | 233c8c9df98dd319fd647804b7062e61e95d6ed9 (patch) | |
| tree | ccc4f01a5bac96efcc81ed1589e1a60911d4fb45 | |
| parent | 7539054b565f7a21355f16f85b9722fadcd28c4c (diff) | |
| download | rust-233c8c9df98dd319fd647804b7062e61e95d6ed9.tar.gz rust-233c8c9df98dd319fd647804b7062e61e95d6ed9.zip | |
hir: Remove `hir::Map::{owner,expect_owner}`
| -rw-r--r-- | clippy_lints/src/methods/iter_nth_zero.rs | 2 | ||||
| -rw-r--r-- | clippy_lints/src/returns.rs | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/clippy_lints/src/methods/iter_nth_zero.rs b/clippy_lints/src/methods/iter_nth_zero.rs index e1f950d5a4a..262a57ab591 100644 --- a/clippy_lints/src/methods/iter_nth_zero.rs +++ b/clippy_lints/src/methods/iter_nth_zero.rs @@ -11,7 +11,7 @@ use rustc_span::sym; use super::ITER_NTH_ZERO; pub(super) fn check(cx: &LateContext<'_>, expr: &hir::Expr<'_>, recv: &hir::Expr<'_>, arg: &hir::Expr<'_>) { - if let OwnerNode::Item(item) = cx.tcx.hir().owner(cx.tcx.hir().get_parent_item(expr.hir_id)) + if let OwnerNode::Item(item) = cx.tcx.hir_owner_node(cx.tcx.hir().get_parent_item(expr.hir_id)) && let def_id = item.owner_id.to_def_id() && is_trait_method(cx, expr, sym::Iterator) && let Some(Constant::Int(0)) = constant(cx, cx.typeck_results(), arg) diff --git a/clippy_lints/src/returns.rs b/clippy_lints/src/returns.rs index 2293b53b42b..e0175046587 100644 --- a/clippy_lints/src/returns.rs +++ b/clippy_lints/src/returns.rs @@ -183,7 +183,7 @@ impl<'tcx> LateLintPass<'tcx> for Return { && let ExprKind::Ret(Some(ret)) = expr.kind && let ExprKind::Match(.., MatchSource::TryDesugar(_)) = ret.kind // Ensure this is not the final stmt, otherwise removing it would cause a compile error - && let OwnerNode::Item(item) = cx.tcx.hir().owner(cx.tcx.hir().get_parent_item(expr.hir_id)) + && let OwnerNode::Item(item) = cx.tcx.hir_owner_node(cx.tcx.hir().get_parent_item(expr.hir_id)) && let ItemKind::Fn(_, _, body) = item.kind && let block = cx.tcx.hir().body(body).value && let ExprKind::Block(block, _) = block.kind |
