diff --git a/clippy_lints/src/lifetimes.rs b/clippy_lints/src/lifetimes.rs index e84c8b4e5..05c747eee 100644 --- a/clippy_lints/src/lifetimes.rs +++ b/clippy_lints/src/lifetimes.rs @@ -375,7 +375,7 @@ impl<'a, 'tcx> Visitor<'tcx> for RefVisitor<'a, 'tcx> { match ty.kind { TyKind::OpaqueDef(item, _) => { let map = self.cx.tcx.hir(); - let item = map.expect_item(item.id); + let item = map.item(item); walk_item(self, item); walk_ty(self, ty); }, diff --git a/clippy_lints/src/manual_async_fn.rs b/clippy_lints/src/manual_async_fn.rs index 89f5b2ff3..2e2e69359 100644 --- a/clippy_lints/src/manual_async_fn.rs +++ b/clippy_lints/src/manual_async_fn.rs @@ -102,7 +102,7 @@ fn future_trait_ref<'tcx>( ) -> Option<(&'tcx TraitRef<'tcx>, Vec)> { if_chain! { if let TyKind::OpaqueDef(item_id, bounds) = ty.kind; - let item = cx.tcx.hir().item(item_id.id); + let item = cx.tcx.hir().item(item_id); if let ItemKind::OpaqueTy(opaque) = &item.kind; if let Some(trait_ref) = opaque.bounds.iter().find_map(|bound| { if let GenericBound::Trait(poly, _) = bound { diff --git a/clippy_lints/src/missing_inline.rs b/clippy_lints/src/missing_inline.rs index 913d9daff..1264813d3 100644 --- a/clippy_lints/src/missing_inline.rs +++ b/clippy_lints/src/missing_inline.rs @@ -107,7 +107,7 @@ impl<'tcx> LateLintPass<'tcx> for MissingInline { // trait method with default body needs inline in case // an impl is not provided let desc = "a default trait method"; - let item = cx.tcx.hir().expect_trait_item(tit.id.hir_id); + let item = cx.tcx.hir().trait_item(tit.id); check_missing_inline_attrs(cx, &item.attrs, item.span, desc); } }, diff --git a/clippy_lints/src/utils/author.rs b/clippy_lints/src/utils/author.rs index ca60d3352..6e3d4fde1 100644 --- a/clippy_lints/src/utils/author.rs +++ b/clippy_lints/src/utils/author.rs @@ -130,7 +130,7 @@ impl<'tcx> LateLintPass<'tcx> for Author { } fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx hir::Stmt<'_>) { - if !has_attr(cx.sess(), stmt.kind.attrs(|id| cx.tcx.hir().item(id.id))) { + if !has_attr(cx.sess(), stmt.kind.attrs(|id| cx.tcx.hir().item(id))) { return; } prelude(); diff --git a/clippy_lints/src/utils/inspector.rs b/clippy_lints/src/utils/inspector.rs index 9bec24be9..b52083af6 100644 --- a/clippy_lints/src/utils/inspector.rs +++ b/clippy_lints/src/utils/inspector.rs @@ -109,7 +109,7 @@ impl<'tcx> LateLintPass<'tcx> for DeepCodeInspector { } fn check_stmt(&mut self, cx: &LateContext<'tcx>, stmt: &'tcx hir::Stmt<'_>) { - if !has_attr(cx.sess(), stmt.kind.attrs(|id| cx.tcx.hir().item(id.id))) { + if !has_attr(cx.sess(), stmt.kind.attrs(|id| cx.tcx.hir().item(id))) { return; } match stmt.kind {