]> git.lizzy.rs Git - rust.git/commitdiff
Remove in_band_lifetimes
authorPFPoitras <patrick.f.poitras@gmail.com>
Tue, 14 Dec 2021 01:45:08 +0000 (21:45 -0400)
committerPFPoitras <patrick.f.poitras@gmail.com>
Tue, 14 Dec 2021 01:45:08 +0000 (21:45 -0400)
26 files changed:
compiler/rustc_typeck/src/astconv/errors.rs
compiler/rustc_typeck/src/check/_match.rs
compiler/rustc_typeck/src/check/check.rs
compiler/rustc_typeck/src/check/coercion.rs
compiler/rustc_typeck/src/check/dropck.rs
compiler/rustc_typeck/src/check/inherited.rs
compiler/rustc_typeck/src/check/method/suggest.rs
compiler/rustc_typeck/src/check/mod.rs
compiler/rustc_typeck/src/check/op.rs
compiler/rustc_typeck/src/check/pat.rs
compiler/rustc_typeck/src/check/regionck.rs
compiler/rustc_typeck/src/check/upvar.rs
compiler/rustc_typeck/src/check/wfcheck.rs
compiler/rustc_typeck/src/check_unused.rs
compiler/rustc_typeck/src/coherence/builtin.rs
compiler/rustc_typeck/src/coherence/inherent_impls.rs
compiler/rustc_typeck/src/coherence/inherent_impls_overlap.rs
compiler/rustc_typeck/src/coherence/orphan.rs
compiler/rustc_typeck/src/coherence/unsafety.rs
compiler/rustc_typeck/src/collect.rs
compiler/rustc_typeck/src/collect/type_of.rs
compiler/rustc_typeck/src/expr_use_visitor.rs
compiler/rustc_typeck/src/impl_wf_check.rs
compiler/rustc_typeck/src/lib.rs
compiler/rustc_typeck/src/outlives/test.rs
compiler/rustc_typeck/src/variance/test.rs

index ec75e4a55d4e5b5aa7d569413f4493f2159b3793..ea54b85b2f20c889162316f7d570f11cffc572ff 100644 (file)
@@ -92,7 +92,7 @@ pub(crate) fn complain_about_internal_fn_trait(
         &self,
         span: Span,
         trait_def_id: DefId,
-        trait_segment: &'a hir::PathSegment<'a>,
+        trait_segment: &'_ hir::PathSegment<'_>,
     ) {
         let trait_def = self.tcx().trait_def(trait_def_id);
 
index a8160313228b6381b02f6e1633fce45ae07e639b..405e4e8594a3ac60bd3d3210a49f57b73b35a4dc 100644 (file)
@@ -557,7 +557,7 @@ pub(crate) fn opt_suggest_box_span(
     }
 }
 
-fn arms_contain_ref_bindings(arms: &'tcx [hir::Arm<'tcx>]) -> Option<hir::Mutability> {
+fn arms_contain_ref_bindings<'tcx>(arms: &'tcx [hir::Arm<'tcx>]) -> Option<hir::Mutability> {
     arms.iter().filter_map(|a| a.pat.contains_explicit_ref_binding()).max_by_key(|m| match *m {
         hir::Mutability::Mut => 1,
         hir::Mutability::Not => 0,
index 5a6bac9ec03d1b5c53c91186dbd5dc396906f0de..fd7b3a55dfb97b59d61bb1e2cca8e3f2c6ae65ce 100644 (file)
@@ -453,7 +453,7 @@ pub(super) fn check_opaque<'tcx>(
 /// Checks that an opaque type does not use `Self` or `T::Foo` projections that would result
 /// in "inheriting lifetimes".
 #[instrument(level = "debug", skip(tcx, span))]
-pub(super) fn check_opaque_for_inheriting_lifetimes(
+pub(super) fn check_opaque_for_inheriting_lifetimes<'tcx>(
     tcx: TyCtxt<'tcx>,
     def_id: LocalDefId,
     span: Span,
@@ -517,7 +517,7 @@ fn visit_ty(&mut self, t: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
         }
     }
 
-    impl Visitor<'tcx> for ProhibitOpaqueVisitor<'tcx> {
+    impl<'tcx> Visitor<'tcx> for ProhibitOpaqueVisitor<'tcx> {
         type Map = rustc_middle::hir::map::Map<'tcx>;
 
         fn nested_visit_map(&mut self) -> hir::intravisit::NestedVisitorMap<Self::Map> {
@@ -1512,7 +1512,7 @@ pub(super) fn check_mod_item_types(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
 
 pub(super) use wfcheck::check_impl_item as check_impl_item_well_formed;
 
-fn async_opaque_type_cycle_error(tcx: TyCtxt<'tcx>, span: Span) {
+fn async_opaque_type_cycle_error(tcx: TyCtxt<'_>, span: Span) {
     struct_span_err!(tcx.sess, span, E0733, "recursion in an `async fn` requires boxing")
         .span_label(span, "recursive `async fn`")
         .note("a recursive `async fn` must be rewritten to return a boxed `dyn Future`")
@@ -1530,7 +1530,7 @@ fn async_opaque_type_cycle_error(tcx: TyCtxt<'tcx>, span: Span) {
 ///
 /// If all the return expressions evaluate to `!`, then we explain that the error will go away
 /// after changing it. This can happen when a user uses `panic!()` or similar as a placeholder.
-fn opaque_type_cycle_error(tcx: TyCtxt<'tcx>, def_id: LocalDefId, span: Span) {
+fn opaque_type_cycle_error(tcx: TyCtxt<'_>, def_id: LocalDefId, span: Span) {
     let mut err = struct_span_err!(tcx.sess, span, E0720, "cannot resolve opaque type");
 
     let mut label = false;
index b4810b4e22fe4f8a6603f1e640c419200d5fe81a..ac18908e95bcda2ea2430fcbc48cd32a196f0888 100644 (file)
@@ -102,7 +102,7 @@ fn identity(_: Ty<'_>) -> Vec<Adjustment<'_>> {
     vec![]
 }
 
-fn simple(kind: Adjust<'tcx>) -> impl FnOnce(Ty<'tcx>) -> Vec<Adjustment<'tcx>> {
+fn simple<'tcx>(kind: Adjust<'tcx>) -> impl FnOnce(Ty<'tcx>) -> Vec<Adjustment<'tcx>> {
     move |target| vec![Adjustment { kind, target }]
 }
 
@@ -1694,7 +1694,7 @@ fn add_impl_trait_explanation<'a>(
         err.help("you could instead create a new `enum` with a variant for each returned type");
     }
 
-    fn is_return_ty_unsized(&self, fcx: &FnCtxt<'a, 'tcx>, blk_id: hir::HirId) -> bool {
+    fn is_return_ty_unsized<'a>(&self, fcx: &FnCtxt<'a, 'tcx>, blk_id: hir::HirId) -> bool {
         if let Some((fn_decl, _)) = fcx.get_fn_decl(blk_id) {
             if let hir::FnRetTy::Return(ty) = fn_decl.output {
                 let ty = <dyn AstConv<'_>>::ast_ty_to_ty(fcx, ty);
index 4b4d29307ff6fafc125d2cd606a2d32fc6e928bd..3cc66aaf0d79c3ec8675a7f8c924f6caada1af9c 100644 (file)
@@ -302,7 +302,7 @@ fn new(tcx: TyCtxt<'tcx>, param_env: ty::ParamEnv<'tcx>) -> SimpleEqRelation<'tc
     }
 }
 
-impl TypeRelation<'tcx> for SimpleEqRelation<'tcx> {
+impl<'tcx> TypeRelation<'tcx> for SimpleEqRelation<'tcx> {
     fn tcx(&self) -> TyCtxt<'tcx> {
         self.tcx
     }
index bf52e7750433138689e5748b841307cda9ae8432..beb6b371b2bb8de1dba246009a5569c74f96a412 100644 (file)
@@ -76,7 +76,7 @@ pub struct InheritedBuilder<'tcx> {
     def_id: LocalDefId,
 }
 
-impl Inherited<'_, 'tcx> {
+impl<'tcx> Inherited<'_, 'tcx> {
     pub fn build(tcx: TyCtxt<'tcx>, def_id: LocalDefId) -> InheritedBuilder<'tcx> {
         let hir_owner = tcx.hir().local_def_id_to_hir_id(def_id).owner;
 
@@ -97,7 +97,7 @@ pub fn enter<F, R>(&mut self, f: F) -> R
     }
 }
 
-impl Inherited<'a, 'tcx> {
+impl<'a, 'tcx> Inherited<'a, 'tcx> {
     pub(super) fn new(infcx: InferCtxt<'a, 'tcx>, def_id: LocalDefId) -> Self {
         let tcx = infcx.tcx;
         let item_id = tcx.hir().local_def_id_to_hir_id(def_id);
index 45b8e13d328c5442bba67af09550d8136786d621..8392731b28d619df44841895ab084ac2ba9a8fa4 100644 (file)
@@ -1968,7 +1968,7 @@ fn find_use_placement<'tcx>(tcx: TyCtxt<'tcx>, target_module: LocalDefId) -> (Op
     (span, found_use)
 }
 
-fn print_disambiguation_help(
+fn print_disambiguation_help<'tcx>(
     item_name: Ident,
     args: Option<&'tcx [hir::Expr<'tcx>]>,
     err: &mut DiagnosticBuilder<'_>,
index 2e80f85972fa7afb130e9a89e095d43287bc030c..a9e6b1caff07b03d55d67d979c52368b1031fd6a 100644 (file)
@@ -508,7 +508,7 @@ struct GeneratorTypes<'tcx> {
 
 /// Given a `DefId` for an opaque type in return position, find its parent item's return
 /// expressions.
-fn get_owner_return_paths(
+fn get_owner_return_paths<'tcx>(
     tcx: TyCtxt<'tcx>,
     def_id: LocalDefId,
 ) -> Option<(hir::HirId, ReturnsVisitor<'tcx>)> {
@@ -906,7 +906,7 @@ struct CheckItemTypesVisitor<'tcx> {
     tcx: TyCtxt<'tcx>,
 }
 
-impl ItemLikeVisitor<'tcx> for CheckItemTypesVisitor<'tcx> {
+impl<'tcx> ItemLikeVisitor<'tcx> for CheckItemTypesVisitor<'tcx> {
     fn visit_item(&mut self, i: &'tcx hir::Item<'tcx>) {
         check_item_type(self.tcx, i);
     }
index 4956321eb5cd49ed26e897e3ef0839c76b03305b..8ebfcdd539b67382d883710ab5c40bf25137309b 100644 (file)
@@ -893,7 +893,7 @@ enum Op {
 }
 
 /// Dereferences a single level of immutable referencing.
-fn deref_ty_if_possible(ty: Ty<'tcx>) -> Ty<'tcx> {
+fn deref_ty_if_possible<'tcx>(ty: Ty<'tcx>) -> Ty<'tcx> {
     match ty.kind() {
         ty::Ref(_, ty, hir::Mutability::Not) => ty,
         _ => ty,
@@ -1007,7 +1007,7 @@ fn visit_ty(&mut self, ty: Ty<'tcx>) -> ControlFlow<Self::BreakTy> {
 
 struct TypeParamEraser<'a, 'tcx>(&'a FnCtxt<'a, 'tcx>, Span);
 
-impl TypeFolder<'tcx> for TypeParamEraser<'_, 'tcx> {
+impl<'tcx> TypeFolder<'tcx> for TypeParamEraser<'_, 'tcx> {
     fn tcx(&self) -> TyCtxt<'tcx> {
         self.0.tcx
     }
index cbf33cf1b78a147112c2ad55cd868a845a813eb3..ec06e0b11264d9683f31b944520f7dad3419b202 100644 (file)
@@ -740,7 +740,7 @@ fn check_pat_struct(
         }
     }
 
-    fn check_pat_path(
+    fn check_pat_path<'b>(
         &self,
         pat: &Pat<'_>,
         path_resolution: (Res, Option<Ty<'tcx>>, &'b [hir::PathSegment<'b>]),
@@ -816,7 +816,7 @@ fn maybe_suggest_range_literal(
         false
     }
 
-    fn emit_bad_pat_path(
+    fn emit_bad_pat_path<'b>(
         &self,
         mut e: DiagnosticBuilder<'_>,
         pat_span: Span,
index d2d8b14dd9695e917bd27d2dc4a08d7683993991..1b42edc83be20d18c07a4d59e12daa896ba565d3 100644 (file)
@@ -106,7 +106,7 @@ macro_rules! ignore_err {
 pub(crate) trait OutlivesEnvironmentExt<'tcx> {
     fn add_implied_bounds(
         &mut self,
-        infcx: &InferCtxt<'a, 'tcx>,
+        infcx: &InferCtxt<'_, 'tcx>,
         fn_sig_tys: FxHashSet<Ty<'tcx>>,
         body_id: hir::HirId,
         span: Span,
@@ -130,7 +130,7 @@ impl<'tcx> OutlivesEnvironmentExt<'tcx> for OutlivesEnvironment<'tcx> {
     /// add those assumptions into the outlives-environment.
     ///
     /// Tests: `src/test/ui/regions/regions-free-region-ordering-*.rs`
-    fn add_implied_bounds(
+    fn add_implied_bounds<'a>(
         &mut self,
         infcx: &InferCtxt<'a, 'tcx>,
         fn_sig_tys: FxHashSet<Ty<'tcx>>,
index a98afd1e3e1dc91b534cb82f1035a0740244e653..ffd7d29bbbbeedb9eb52986d8cbfde4910c59653 100644 (file)
@@ -1672,7 +1672,7 @@ fn restrict_repr_packed_field_ref_capture<'tcx>(
 }
 
 /// Returns a Ty that applies the specified capture kind on the provided capture Ty
-fn apply_capture_kind_on_capture_ty(
+fn apply_capture_kind_on_capture_ty<'tcx>(
     tcx: TyCtxt<'tcx>,
     ty: Ty<'tcx>,
     capture_kind: UpvarCapture<'tcx>,
@@ -1685,7 +1685,7 @@ fn apply_capture_kind_on_capture_ty(
 }
 
 /// Returns the Span of where the value with the provided HirId would be dropped
-fn drop_location_span(tcx: TyCtxt<'tcx>, hir_id: &hir::HirId) -> Span {
+fn drop_location_span<'tcx>(tcx: TyCtxt<'tcx>, hir_id: &hir::HirId) -> Span {
     let owner_id = tcx.hir().get_enclosing_scope(*hir_id).unwrap();
 
     let owner_node = tcx.hir().get(owner_id);
@@ -1999,7 +1999,7 @@ fn restrict_precision_for_drop_types<'a, 'tcx>(
 /// - No projections are applied to raw pointers, since these require unsafe blocks. We capture
 ///   them completely.
 /// - No projections are applied on top of Union ADTs, since these require unsafe blocks.
-fn restrict_precision_for_unsafe(
+fn restrict_precision_for_unsafe<'tcx>(
     mut place: Place<'tcx>,
     mut curr_mode: ty::UpvarCapture<'tcx>,
 ) -> (Place<'tcx>, ty::UpvarCapture<'tcx>) {
@@ -2097,7 +2097,7 @@ fn adjust_for_non_move_closure<'tcx>(
     (place, kind)
 }
 
-fn construct_place_string(tcx: TyCtxt<'_>, place: &Place<'tcx>) -> String {
+fn construct_place_string<'tcx>(tcx: TyCtxt<'_>, place: &Place<'tcx>) -> String {
     let variable_name = match place.base {
         PlaceBase::Upvar(upvar_id) => var_name(tcx, upvar_id.var_path.hir_id).to_string(),
         _ => bug!("Capture_information should only contain upvars"),
@@ -2120,7 +2120,7 @@ fn construct_place_string(tcx: TyCtxt<'_>, place: &Place<'tcx>) -> String {
     format!("{}[{}]", variable_name, projections_str)
 }
 
-fn construct_capture_kind_reason_string(
+fn construct_capture_kind_reason_string<'tcx>(
     tcx: TyCtxt<'_>,
     place: &Place<'tcx>,
     capture_info: &ty::CaptureInfo<'tcx>,
@@ -2135,13 +2135,13 @@ fn construct_capture_kind_reason_string(
     format!("{} captured as {} here", place_str, capture_kind_str)
 }
 
-fn construct_path_string(tcx: TyCtxt<'_>, place: &Place<'tcx>) -> String {
+fn construct_path_string<'tcx>(tcx: TyCtxt<'_>, place: &Place<'tcx>) -> String {
     let place_str = construct_place_string(tcx, place);
 
     format!("{} used here", place_str)
 }
 
-fn construct_capture_info_string(
+fn construct_capture_info_string<'tcx>(
     tcx: TyCtxt<'_>,
     place: &Place<'tcx>,
     capture_info: &ty::CaptureInfo<'tcx>,
@@ -2233,7 +2233,7 @@ fn migration_suggestion_for_2229(
 /// would've already handled `E1`, and have an existing capture_information for it.
 /// Calling `determine_capture_info(existing_info_e1, current_info_e2)` will return
 /// `existing_info_e1` in this case, allowing us to point to `E1` in case of diagnostics.
-fn determine_capture_info(
+fn determine_capture_info<'tcx>(
     capture_info_a: ty::CaptureInfo<'tcx>,
     capture_info_b: ty::CaptureInfo<'tcx>,
 ) -> ty::CaptureInfo<'tcx> {
@@ -2292,7 +2292,7 @@ fn determine_capture_info(
 ///
 /// Note: Capture kind changes from `MutBorrow` to `UniqueImmBorrow` if the truncated part of the `place`
 /// contained `Deref` of `&mut`.
-fn truncate_place_to_len_and_update_capture_kind(
+fn truncate_place_to_len_and_update_capture_kind<'tcx>(
     place: &mut Place<'tcx>,
     curr_mode: &mut ty::UpvarCapture<'tcx>,
     len: usize,
@@ -2330,7 +2330,7 @@ fn truncate_place_to_len_and_update_capture_kind(
 /// `PlaceAncestryRelation::Ancestor` implies Place A is ancestor of Place B
 /// `PlaceAncestryRelation::Descendant` implies Place A is descendant of Place B
 /// `PlaceAncestryRelation::Divergent` implies neither of them is the ancestor of the other.
-fn determine_place_ancestry_relation(
+fn determine_place_ancestry_relation<'tcx>(
     place_a: &Place<'tcx>,
     place_b: &Place<'tcx>,
 ) -> PlaceAncestryRelation {
index 3fd3284d8b1015c72bab9b34b384196759522fc7..5c599d70d5c45c5891e73eafaea6c79fa6b27302 100644 (file)
@@ -1450,7 +1450,7 @@ fn check_method_receiver<'fcx, 'tcx>(
     }
 }
 
-fn e0307(fcx: &FnCtxt<'fcx, 'tcx>, span: Span, receiver_ty: Ty<'_>) {
+fn e0307<'fcx, 'tcx> (fcx: &FnCtxt<'fcx, 'tcx>, span: Span, receiver_ty: Ty<'_>) {
     struct_span_err!(
         fcx.tcx.sess.diagnostic(),
         span,
@@ -1553,7 +1553,7 @@ fn receiver_is_valid<'fcx, 'tcx>(
     true
 }
 
-fn receiver_is_implemented(
+fn receiver_is_implemented<'tcx>(
     fcx: &FnCtxt<'_, 'tcx>,
     receiver_trait_def_id: DefId,
     cause: ObligationCause<'tcx>,
@@ -1696,13 +1696,13 @@ pub struct CheckTypeWellFormedVisitor<'tcx> {
     tcx: TyCtxt<'tcx>,
 }
 
-impl CheckTypeWellFormedVisitor<'tcx> {
-    pub fn new(tcx: TyCtxt<'tcx>) -> CheckTypeWellFormedVisitor<'tcx> {
+impl CheckTypeWellFormedVisitor<'_> {
+    pub fn new(tcx: TyCtxt<'_>) -> CheckTypeWellFormedVisitor<'_> {
         CheckTypeWellFormedVisitor { tcx }
     }
 }
 
-impl ParItemLikeVisitor<'tcx> for CheckTypeWellFormedVisitor<'tcx> {
+impl<'tcx> ParItemLikeVisitor<'tcx> for CheckTypeWellFormedVisitor<'tcx> {
     fn visit_item(&self, i: &'tcx hir::Item<'tcx>) {
         Visitor::visit_item(&mut self.clone(), i);
     }
@@ -1720,7 +1720,7 @@ fn visit_foreign_item(&self, foreign_item: &'tcx hir::ForeignItem<'tcx>) {
     }
 }
 
-impl Visitor<'tcx> for CheckTypeWellFormedVisitor<'tcx> {
+impl<'tcx> Visitor<'tcx> for CheckTypeWellFormedVisitor<'tcx> {
     type Map = hir_map::Map<'tcx>;
 
     fn nested_visit_map(&mut self) -> hir_visit::NestedVisitorMap<Self::Map> {
index 79ed83d59ed9728c5c292e82e345a596c7cde65a..f63561f0582a65976de63d9a906039146138f5b4 100644 (file)
@@ -21,7 +21,7 @@ pub fn check_crate(tcx: TyCtxt<'_>) {
     unused_crates_lint(tcx);
 }
 
-impl ItemLikeVisitor<'v> for CheckVisitor<'tcx> {
+impl <'v, 'tcx> ItemLikeVisitor<'v> for CheckVisitor<'tcx> {
     fn visit_item(&mut self, item: &hir::Item<'_>) {
         if item.vis.node.is_pub() || item.span.is_dummy() {
             return;
@@ -43,7 +43,7 @@ struct CheckVisitor<'tcx> {
     used_trait_imports: FxHashSet<LocalDefId>,
 }
 
-impl CheckVisitor<'tcx> {
+impl<'tcx> CheckVisitor<'tcx> {
     fn check_import(&self, item_id: hir::ItemId, span: Span) {
         if !self.tcx.maybe_unused_trait_import(item_id.def_id) {
             return;
index dfb4304ab02c4de8a860d906af82a655f40b5934..5b277589a3adf78b8ea4855610964fc0ed67a6f6 100644 (file)
@@ -108,7 +108,7 @@ fn visit_implementation_of_copy(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
     }
 }
 
-fn visit_implementation_of_coerce_unsized(tcx: TyCtxt<'tcx>, impl_did: LocalDefId) {
+fn visit_implementation_of_coerce_unsized(tcx: TyCtxt<'_>, impl_did: LocalDefId) {
     debug!("visit_implementation_of_coerce_unsized: impl_did={:?}", impl_did);
 
     // Just compute this for the side-effects, in particular reporting
@@ -287,7 +287,7 @@ fn visit_implementation_of_dispatch_from_dyn(tcx: TyCtxt<'_>, impl_did: LocalDef
     })
 }
 
-pub fn coerce_unsized_info(tcx: TyCtxt<'tcx>, impl_did: DefId) -> CoerceUnsizedInfo {
+pub fn coerce_unsized_info<'tcx>(tcx: TyCtxt<'tcx>, impl_did: DefId) -> CoerceUnsizedInfo {
     debug!("compute_coerce_unsized_info(impl_did={:?})", impl_did);
 
     // this provider should only get invoked for local def-ids
index 6a9ba9d49134ca1823c5d8267b4969b046e35357..0c38dc5b4bdeba08faa5e8ab5d4c16cfaa61fbbc 100644 (file)
@@ -38,7 +38,7 @@ struct InherentCollect<'tcx> {
     impls_map: CrateInherentImpls,
 }
 
-impl ItemLikeVisitor<'v> for InherentCollect<'tcx> {
+impl<'v, 'tcx> ItemLikeVisitor<'v> 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, .. }) => {
@@ -370,7 +370,7 @@ fn visit_impl_item(&mut self, _impl_item: &hir::ImplItem<'_>) {}
     fn visit_foreign_item(&mut self, _foreign_item: &hir::ForeignItem<'_>) {}
 }
 
-impl InherentCollect<'tcx> {
+impl<'tcx> InherentCollect<'tcx> {
     fn check_def_id(&mut self, item: &hir::Item<'_>, def_id: DefId) {
         if let Some(def_id) = def_id.as_local() {
             // Add the implementation to the mapping from implementation to base
index beacf301cae27ac392688cd6615011e5a684ecf6..18892db4b3aef83f086e71bde70147c82de5996d 100644 (file)
@@ -18,7 +18,7 @@ struct InherentOverlapChecker<'tcx> {
     tcx: TyCtxt<'tcx>,
 }
 
-impl InherentOverlapChecker<'tcx> {
+impl<'tcx> InherentOverlapChecker<'tcx> {
     /// Checks whether any associated items in impls 1 and 2 share the same identifier and
     /// namespace.
     fn impls_have_common_items(
@@ -115,7 +115,7 @@ fn check_for_overlapping_inherent_impls(&self, impl1_def_id: DefId, impl2_def_id
     }
 }
 
-impl ItemLikeVisitor<'v> for InherentOverlapChecker<'tcx> {
+impl<'v, 'tcx> ItemLikeVisitor<'v> for InherentOverlapChecker<'tcx> {
     fn visit_item(&mut self, item: &'v hir::Item<'v>) {
         match item.kind {
             hir::ItemKind::Enum(..)
index b450d3f6c08ab98b04f1d622855b9ed10de1ffda..e954b4cf512c5a8820341333fa5b9d8aa4d9282c 100644 (file)
@@ -143,7 +143,7 @@ fn orphan_check_impl(tcx: TyCtxt<'_>, def_id: LocalDefId) -> Result<(), ErrorRep
     Ok(())
 }
 
-fn emit_orphan_check_error(
+fn emit_orphan_check_error<'tcx>(
     tcx: TyCtxt<'tcx>,
     sp: Span,
     trait_span: Span,
index e7b03fa3ac68a9d83e05ccf15e8c84b70a34100f..5a0a84a4aa61a013fdb9bf72f25b53f0aa12ec89 100644 (file)
@@ -16,8 +16,8 @@ struct UnsafetyChecker<'tcx> {
     tcx: TyCtxt<'tcx>,
 }
 
-impl UnsafetyChecker<'tcx> {
-    fn check_unsafety_coherence(
+impl<'tcx> UnsafetyChecker<'tcx> {
+    fn check_unsafety_coherence<'v>(
         &mut self,
         item: &'v hir::Item<'v>,
         impl_generics: Option<&hir::Generics<'_>>,
@@ -83,7 +83,7 @@ fn check_unsafety_coherence(
     }
 }
 
-impl ItemLikeVisitor<'v> for UnsafetyChecker<'tcx> {
+impl<'v, 'tcx> ItemLikeVisitor<'v> for UnsafetyChecker<'tcx> {
     fn visit_item(&mut self, item: &'v hir::Item<'v>) {
         if let hir::ItemKind::Impl(ref impl_) = item.kind {
             self.check_unsafety_coherence(
index ea86bafffb394bfe188692e4ec61f345bb111f89..8057dc2effa79e1cdb607612662b5b6a7ae946af 100644 (file)
@@ -147,7 +147,7 @@ struct CollectItemTypesVisitor<'tcx> {
 /// If there are any placeholder types (`_`), emit an error explaining that this is not allowed
 /// and suggest adding type parameters in the appropriate place, taking into consideration any and
 /// all already existing generic type parameters to avoid suggesting a name that is already in use.
-crate fn placeholder_type_error(
+crate fn placeholder_type_error<'tcx>(
     tcx: TyCtxt<'tcx>,
     span: Option<Span>,
     generics: &[hir::GenericParam<'_>],
@@ -223,7 +223,7 @@ struct CollectItemTypesVisitor<'tcx> {
     err.emit();
 }
 
-fn reject_placeholder_type_signatures_in_item(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)
@@ -251,7 +251,7 @@ fn reject_placeholder_type_signatures_in_item(tcx: TyCtxt<'tcx>, item: &'tcx hir
     );
 }
 
-impl Visitor<'tcx> for CollectItemTypesVisitor<'tcx> {
+impl<'tcx> Visitor<'tcx> for CollectItemTypesVisitor<'tcx> {
     type Map = Map<'tcx>;
 
     fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
@@ -311,7 +311,7 @@ fn visit_impl_item(&mut self, impl_item: &'tcx hir::ImplItem<'tcx>) {
 ///////////////////////////////////////////////////////////////////////////
 // Utility types and common code for the above passes.
 
-fn bad_placeholder_type(
+fn bad_placeholder_type<'tcx>(
     tcx: TyCtxt<'tcx>,
     mut spans: Vec<Span>,
     kind: &'static str,
@@ -332,7 +332,7 @@ fn bad_placeholder_type(
     err
 }
 
-impl ItemCtxt<'tcx> {
+impl<'tcx> ItemCtxt<'tcx> {
     pub fn new(tcx: TyCtxt<'tcx>, item_def_id: DefId) -> ItemCtxt<'tcx> {
         ItemCtxt { tcx, item_def_id }
     }
@@ -350,7 +350,7 @@ pub fn node(&self) -> hir::Node<'tcx> {
     }
 }
 
-impl AstConv<'tcx> for ItemCtxt<'tcx> {
+impl<'tcx> AstConv<'tcx> for ItemCtxt<'tcx> {
     fn tcx(&self) -> TyCtxt<'tcx> {
         self.tcx
     }
@@ -643,7 +643,7 @@ fn type_param_predicates(
     result
 }
 
-impl ItemCtxt<'tcx> {
+impl<'tcx> ItemCtxt<'tcx> {
     /// Finds bounds from `hir::Generics`. This requires scanning through the
     /// AST. We do this to avoid having to convert *all* the bounds, which
     /// would create artificial cycles. Instead, we can only convert the
@@ -1239,7 +1239,7 @@ struct LateBoundRegionsDetector<'tcx> {
         has_late_bound_regions: Option<Span>,
     }
 
-    impl Visitor<'tcx> for LateBoundRegionsDetector<'tcx> {
+    impl<'tcx> Visitor<'tcx> for LateBoundRegionsDetector<'tcx> {
         type Map = intravisit::ErasedMap<'tcx>;
 
         fn nested_visit_map(&mut self) -> NestedVisitorMap<Self::Map> {
@@ -1746,7 +1746,7 @@ fn is_suggestable_infer_ty(ty: &hir::Ty<'_>) -> bool {
     }
 }
 
-pub fn get_infer_ret_ty(output: &'hir hir::FnRetTy<'hir>) -> Option<&'hir hir::Ty<'hir>> {
+pub fn get_infer_ret_ty<'hir>(output: &'hir hir::FnRetTy<'hir>) -> Option<&'hir hir::Ty<'hir>> {
     if let hir::FnRetTy::Return(ty) = output {
         if is_suggestable_infer_ty(ty) {
             return Some(&*ty);
index af199ca99460f292a1236e55966669ba6859e70c..99fddcb00ceca52b2a2994e8c16a174d4b5d8a62 100644 (file)
@@ -731,7 +731,7 @@ fn new(tcx: TyCtxt<'tcx>) -> Self {
         }
     }
 
-    impl TypeFolder<'tcx> for MakeNameable<'tcx> {
+    impl<'tcx> TypeFolder<'tcx> for MakeNameable<'tcx> {
         fn tcx(&self) -> TyCtxt<'tcx> {
             self.tcx
         }
index 7d0600b99e36e45d416ed6266695b0339946baba..0896daf48b78435f0d5afc868ef126c4c195af45 100644 (file)
@@ -482,7 +482,7 @@ fn walk_block(&mut self, blk: &hir::Block<'_>) {
         }
     }
 
-    fn walk_struct_expr(
+    fn walk_struct_expr<'hir>(
         &mut self,
         fields: &[hir::ExprField<'_>],
         opt_with: &Option<&'hir hir::Expr<'_>>,
@@ -705,7 +705,7 @@ fn walk_pat(&mut self, discr_place: &PlaceWithHirId<'tcx>, pat: &hir::Pat<'_>) {
     /// - When reporting the Place back to the Delegate, ensure that the UpvarId uses the enclosing
     /// closure as the DefId.
     fn walk_captures(&mut self, closure_expr: &hir::Expr<'_>) {
-        fn upvar_is_local_variable(
+        fn upvar_is_local_variable<'tcx>(
             upvars: Option<&'tcx FxIndexMap<hir::HirId, hir::Upvar>>,
             upvar_id: &hir::HirId,
             body_owner_is_closure: bool,
@@ -846,7 +846,7 @@ fn delegate_consume<'a, 'tcx>(
     }
 }
 
-fn is_multivariant_adt(ty: Ty<'tcx>) -> bool {
+fn is_multivariant_adt(ty: Ty<'_>) -> bool {
     if let ty::Adt(def, _) = ty.kind() {
         // Note that if a non-exhaustive SingleVariant is defined in another crate, we need
         // to assume that more cases will be added to the variant in the future. This mean
index 5d2f8fc4242756b798c1c9485cf999603f78fce3..ae6321de7f2d5d34aa8546063a03a44135eca0fe 100644 (file)
@@ -76,7 +76,7 @@ struct ImplWfCheck<'tcx> {
     min_specialization: bool,
 }
 
-impl ItemLikeVisitor<'tcx> for ImplWfCheck<'tcx> {
+impl<'tcx> ItemLikeVisitor<'tcx> for ImplWfCheck<'tcx> {
     fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
         if let hir::ItemKind::Impl(ref impl_) = item.kind {
             enforce_impl_params_are_constrained(self.tcx, item.def_id, impl_.items);
index 41e06f43c461678a938cc547d2e9b7f0caf6b090..ea777d90a9c55a31c457c5cf0102a8697f47a101 100644 (file)
@@ -59,7 +59,6 @@
 #![feature(bool_to_option)]
 #![feature(crate_visibility_modifier)]
 #![feature(if_let_guard)]
-#![feature(in_band_lifetimes)]
 #![feature(is_sorted)]
 #![feature(iter_zip)]
 #![feature(let_else)]
index ec4fa9cd4b577e64c6444e5a53839ddcbae506b0..b3efd9f9ec36747b42b63632974b5ad5a0b5c0b1 100644 (file)
@@ -12,7 +12,7 @@ struct OutlivesTest<'tcx> {
     tcx: TyCtxt<'tcx>,
 }
 
-impl ItemLikeVisitor<'tcx> for OutlivesTest<'tcx> {
+impl<'tcx> ItemLikeVisitor<'tcx> for OutlivesTest<'tcx> {
     fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
         // For unit testing: check for a special "rustc_outlives"
         // attribute and report an error with various results if found.
index 7be3c68e8f617c5228154afcbab96fe04db80627..d6959075d888379671221b8ca539528109a7dcb6 100644 (file)
@@ -12,7 +12,7 @@ struct VarianceTest<'tcx> {
     tcx: TyCtxt<'tcx>,
 }
 
-impl ItemLikeVisitor<'tcx> for VarianceTest<'tcx> {
+impl<'tcx> ItemLikeVisitor<'tcx> for VarianceTest<'tcx> {
     fn visit_item(&mut self, item: &'tcx hir::Item<'tcx>) {
         // For unit testing: check for a special "rustc_variance"
         // attribute and report an error with various results if found.