diff --git a/compiler/rustc_typeck/src/check/wfcheck.rs b/compiler/rustc_typeck/src/check/wfcheck.rs index 5c599d70d5c45..b6ffef8d1b3d1 100644 --- a/compiler/rustc_typeck/src/check/wfcheck.rs +++ b/compiler/rustc_typeck/src/check/wfcheck.rs @@ -1450,7 +1450,7 @@ fn check_method_receiver<'fcx, 'tcx>( } } -fn e0307<'fcx, 'tcx> (fcx: &FnCtxt<'fcx, 'tcx>, span: Span, receiver_ty: Ty<'_>) { +fn e0307<'tcx>(fcx: &FnCtxt<'_, 'tcx>, span: Span, receiver_ty: Ty<'_>) { struct_span_err!( fcx.tcx.sess.diagnostic(), span, @@ -1696,8 +1696,8 @@ pub struct CheckTypeWellFormedVisitor<'tcx> { tcx: TyCtxt<'tcx>, } -impl CheckTypeWellFormedVisitor<'_> { - pub fn new(tcx: TyCtxt<'_>) -> CheckTypeWellFormedVisitor<'_> { +impl<'tcx> CheckTypeWellFormedVisitor<'tcx> { + pub fn new(tcx: TyCtxt<'tcx>) -> CheckTypeWellFormedVisitor<'tcx> { CheckTypeWellFormedVisitor { tcx } } } diff --git a/compiler/rustc_typeck/src/check_unused.rs b/compiler/rustc_typeck/src/check_unused.rs index f63561f0582a6..f45cd3ed68948 100644 --- a/compiler/rustc_typeck/src/check_unused.rs +++ b/compiler/rustc_typeck/src/check_unused.rs @@ -21,7 +21,7 @@ pub fn check_crate(tcx: TyCtxt<'_>) { unused_crates_lint(tcx); } -impl <'v, 'tcx> ItemLikeVisitor<'v> for CheckVisitor<'tcx> { +impl<'tcx> ItemLikeVisitor<'_> for CheckVisitor<'tcx> { fn visit_item(&mut self, item: &hir::Item<'_>) { if item.vis.node.is_pub() || item.span.is_dummy() { return; diff --git a/compiler/rustc_typeck/src/coherence/builtin.rs b/compiler/rustc_typeck/src/coherence/builtin.rs index 5b277589a3adf..d5494c5a68548 100644 --- a/compiler/rustc_typeck/src/coherence/builtin.rs +++ b/compiler/rustc_typeck/src/coherence/builtin.rs @@ -108,7 +108,7 @@ fn visit_implementation_of_copy(tcx: TyCtxt<'_>, impl_did: LocalDefId) { } } -fn visit_implementation_of_coerce_unsized(tcx: TyCtxt<'_>, impl_did: LocalDefId) { +fn visit_implementation_of_coerce_unsized<'tcx>(tcx: TyCtxt<'tcx>, impl_did: LocalDefId) { debug!("visit_implementation_of_coerce_unsized: impl_did={:?}", impl_did); // Just compute this for the side-effects, in particular reporting @@ -118,7 +118,7 @@ fn visit_implementation_of_coerce_unsized(tcx: TyCtxt<'_>, impl_did: LocalDefId) tcx.at(span).coerce_unsized_info(impl_did); } -fn visit_implementation_of_dispatch_from_dyn(tcx: TyCtxt<'_>, impl_did: LocalDefId) { +fn visit_implementation_of_dispatch_from_dyn<'tcx>(tcx: TyCtxt<'tcx>, impl_did: LocalDefId) { debug!("visit_implementation_of_dispatch_from_dyn: impl_did={:?}", impl_did); let impl_hir_id = tcx.hir().local_def_id_to_hir_id(impl_did); diff --git a/compiler/rustc_typeck/src/coherence/inherent_impls.rs b/compiler/rustc_typeck/src/coherence/inherent_impls.rs index 0c38dc5b4bdeb..f4e5cce0129c9 100644 --- a/compiler/rustc_typeck/src/coherence/inherent_impls.rs +++ b/compiler/rustc_typeck/src/coherence/inherent_impls.rs @@ -38,7 +38,7 @@ struct InherentCollect<'tcx> { impls_map: CrateInherentImpls, } -impl<'v, 'tcx> ItemLikeVisitor<'v> for InherentCollect<'tcx> { +impl<'tcx> ItemLikeVisitor<'_> for InherentCollect<'tcx> { fn visit_item(&mut self, item: &hir::Item<'_>) { let (ty, assoc_items) = match item.kind { hir::ItemKind::Impl(hir::Impl { of_trait: None, ref self_ty, items, .. }) => { diff --git a/compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs b/compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs index 18892db4b3aef..59f211bd2c36c 100644 --- a/compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs +++ b/compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs @@ -115,8 +115,8 @@ impl<'tcx> InherentOverlapChecker<'tcx> { } } -impl<'v, 'tcx> ItemLikeVisitor<'v> for InherentOverlapChecker<'tcx> { - fn visit_item(&mut self, item: &'v hir::Item<'v>) { +impl<'tcx> ItemLikeVisitor<'_> for InherentOverlapChecker<'tcx> { + fn visit_item(&mut self, item: &hir::Item<'_>) { match item.kind { hir::ItemKind::Enum(..) | hir::ItemKind::Struct(..) @@ -300,9 +300,9 @@ impl<'v, 'tcx> ItemLikeVisitor<'v> for InherentOverlapChecker<'tcx> { } } - fn visit_trait_item(&mut self, _trait_item: &hir::TraitItem<'v>) {} + fn visit_trait_item(&mut self, _trait_item: &hir::TraitItem<'_>) {} - fn visit_impl_item(&mut self, _impl_item: &hir::ImplItem<'v>) {} + fn visit_impl_item(&mut self, _impl_item: &hir::ImplItem<'_>) {} - fn visit_foreign_item(&mut self, _foreign_item: &hir::ForeignItem<'v>) {} + fn visit_foreign_item(&mut self, _foreign_item: &hir::ForeignItem<'_>) {} } diff --git a/compiler/rustc_typeck/src/coherence/unsafety.rs b/compiler/rustc_typeck/src/coherence/unsafety.rs index 5a0a84a4aa61a..f7aabf2406f37 100644 --- a/compiler/rustc_typeck/src/coherence/unsafety.rs +++ b/compiler/rustc_typeck/src/coherence/unsafety.rs @@ -17,9 +17,9 @@ struct UnsafetyChecker<'tcx> { } impl<'tcx> UnsafetyChecker<'tcx> { - fn check_unsafety_coherence<'v>( + fn check_unsafety_coherence( &mut self, - item: &'v hir::Item<'v>, + item: &hir::Item<'_>, impl_generics: Option<&hir::Generics<'_>>, unsafety: hir::Unsafety, polarity: hir::ImplPolarity, @@ -83,8 +83,8 @@ impl<'tcx> UnsafetyChecker<'tcx> { } } -impl<'v, 'tcx> ItemLikeVisitor<'v> for UnsafetyChecker<'tcx> { - fn visit_item(&mut self, item: &'v hir::Item<'v>) { +impl<'tcx> ItemLikeVisitor<'_> for UnsafetyChecker<'tcx> { + fn visit_item(&mut self, item: &hir::Item<'_>) { if let hir::ItemKind::Impl(ref impl_) = item.kind { self.check_unsafety_coherence( item, diff --git a/compiler/rustc_typeck/src/collect.rs b/compiler/rustc_typeck/src/collect.rs index 8057dc2effa79..b96a5b158a268 100644 --- a/compiler/rustc_typeck/src/collect.rs +++ b/compiler/rustc_typeck/src/collect.rs @@ -223,7 +223,10 @@ crate fn placeholder_type_error<'tcx>( err.emit(); } -fn reject_placeholder_type_signatures_in_item<'tcx>(tcx: TyCtxt<'tcx>, item: &'tcx hir::Item<'tcx>) { +fn reject_placeholder_type_signatures_in_item<'tcx>( + tcx: TyCtxt<'tcx>, + item: &'tcx hir::Item<'tcx>, +) { let (generics, suggest) = match &item.kind { hir::ItemKind::Union(_, generics) | hir::ItemKind::Enum(_, generics)