]> git.lizzy.rs Git - rust.git/commitdiff
don't elide lifetimes in paths in librustc/
authorZack M. Davis <code@zackmdavis.net>
Thu, 30 Aug 2018 05:02:42 +0000 (22:02 -0700)
committerZack M. Davis <code@zackmdavis.net>
Sun, 30 Sep 2018 04:48:29 +0000 (21:48 -0700)
This seemed like a good way to kick the tires on the
elided-lifetimes-in-paths lint (#52069)—seems to work! This was also
pretty tedious—it sure would be nice if `cargo fix` worked on this
codebase (#53896)!

77 files changed:
src/librustc/dep_graph/dep_node.rs
src/librustc/hir/def_id.rs
src/librustc/hir/lowering.rs
src/librustc/hir/map/blocks.rs
src/librustc/hir/map/mod.rs
src/librustc/hir/mod.rs
src/librustc/hir/print.rs
src/librustc/infer/error_reporting/mod.rs
src/librustc/infer/error_reporting/nice_region_error/util.rs
src/librustc/infer/error_reporting/note.rs
src/librustc/infer/higher_ranked/mod.rs
src/librustc/infer/lexical_region_resolve/graphviz.rs
src/librustc/infer/lexical_region_resolve/mod.rs
src/librustc/infer/mod.rs
src/librustc/infer/opaque_types/mod.rs
src/librustc/infer/outlives/free_region_map.rs
src/librustc/infer/region_constraints/mod.rs
src/librustc/lib.rs
src/librustc/lint/builtin.rs
src/librustc/lint/context.rs
src/librustc/lint/levels.rs
src/librustc/lint/mod.rs
src/librustc/middle/cstore.rs
src/librustc/middle/dead.rs
src/librustc/middle/dependency_format.rs
src/librustc/middle/entry.rs
src/librustc/middle/exported_symbols.rs
src/librustc/middle/expr_use_visitor.rs
src/librustc/middle/liveness.rs
src/librustc/middle/mem_categorization.rs
src/librustc/middle/privacy.rs
src/librustc/middle/reachable.rs
src/librustc/middle/region.rs
src/librustc/middle/resolve_lifetime.rs
src/librustc/middle/weak_lang_items.rs
src/librustc/mir/cache.rs
src/librustc/mir/interpret/error.rs
src/librustc/mir/interpret/mod.rs
src/librustc/mir/mod.rs
src/librustc/session/config.rs
src/librustc/session/mod.rs
src/librustc/session/search_paths.rs
src/librustc/traits/auto_trait.rs
src/librustc/traits/coherence.rs
src/librustc/traits/error_reporting.rs
src/librustc/traits/mod.rs
src/librustc/traits/on_unimplemented.rs
src/librustc/traits/query/type_op/custom.rs
src/librustc/traits/select.rs
src/librustc/traits/specialize/mod.rs
src/librustc/traits/specialize/specialization_graph.rs
src/librustc/traits/structural_impls.rs
src/librustc/ty/codec.rs
src/librustc/ty/context.rs
src/librustc/ty/erase_regions.rs
src/librustc/ty/error.rs
src/librustc/ty/fast_reject.rs
src/librustc/ty/flags.rs
src/librustc/ty/fold.rs
src/librustc/ty/instance.rs
src/librustc/ty/item_path.rs
src/librustc/ty/layout.rs
src/librustc/ty/mod.rs
src/librustc/ty/query/README.md
src/librustc/ty/query/config.rs
src/librustc/ty/query/keys.rs
src/librustc/ty/query/mod.rs
src/librustc/ty/query/on_disk_cache.rs
src/librustc/ty/query/plumbing.rs
src/librustc/ty/steal.rs
src/librustc/ty/sty.rs
src/librustc/ty/subst.rs
src/librustc/ty/util.rs
src/librustc/util/bug.rs
src/librustc/util/common.rs
src/librustc/util/ppaux.rs
src/librustc/util/profiling.rs

index d15568af6aebec8f6ea641da55543a2d38a7904e..0d0dc0832a459b78aab728ea30bbb11cca5bd6fc 100644 (file)
@@ -331,7 +331,7 @@ pub fn new_no_params(kind: DepKind) -> DepNode {
             /// refers to something from the previous compilation session that
             /// has been removed.
             #[inline]
-            pub fn extract_def_id(&self, tcx: TyCtxt) -> Option<DefId> {
+            pub fn extract_def_id(&self, tcx: TyCtxt<'_, '_, '_>) -> Option<DefId> {
                 if self.kind.can_reconstruct_query_key() {
                     let def_path_hash = DefPathHash(self.hash);
                     tcx.def_path_hash_to_def_id.as_ref()?
@@ -386,7 +386,7 @@ pub mod label_strs {
 }
 
 impl fmt::Debug for DepNode {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{:?}", self.kind)?;
 
         if !self.kind.has_params() && !self.kind.is_anon() {
@@ -424,7 +424,7 @@ pub fn to_dep_node(self, kind: DepKind) -> DepNode {
 
 impl DefId {
     #[inline]
-    pub fn to_dep_node(self, tcx: TyCtxt, kind: DepKind) -> DepNode {
+    pub fn to_dep_node(self, tcx: TyCtxt<'_, '_, '_>, kind: DepKind) -> DepNode {
         DepNode::from_def_path_hash(kind, tcx.def_path_hash(self))
     }
 }
@@ -714,7 +714,7 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a, T> DepNodeParams<'a, 'gcx, 'tcx> for T
 impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for DefId {
     const CAN_RECONSTRUCT_QUERY_KEY: bool = true;
 
-    fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
+    fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
         tcx.def_path_hash(*self).0
     }
 
@@ -726,7 +726,7 @@ fn to_debug_str(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> String {
 impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for DefIndex {
     const CAN_RECONSTRUCT_QUERY_KEY: bool = true;
 
-    fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
+    fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
         tcx.hir.definitions().def_path_hash(*self).0
     }
 
@@ -738,7 +738,7 @@ fn to_debug_str(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> String {
 impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for CrateNum {
     const CAN_RECONSTRUCT_QUERY_KEY: bool = true;
 
-    fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
+    fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
         let def_id = DefId {
             krate: *self,
             index: CRATE_DEF_INDEX,
@@ -757,7 +757,7 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for (DefId, De
     // We actually would not need to specialize the implementation of this
     // method but it's faster to combine the hashes than to instantiate a full
     // hashing context and stable-hashing state.
-    fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
+    fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
         let (def_id_0, def_id_1) = *self;
 
         let def_path_hash_0 = tcx.def_path_hash(def_id_0);
@@ -781,7 +781,7 @@ impl<'a, 'gcx: 'tcx + 'a, 'tcx: 'a> DepNodeParams<'a, 'gcx, 'tcx> for HirId {
     // We actually would not need to specialize the implementation of this
     // method but it's faster to combine the hashes than to instantiate a full
     // hashing context and stable-hashing state.
-    fn to_fingerprint(&self, tcx: TyCtxt) -> Fingerprint {
+    fn to_fingerprint(&self, tcx: TyCtxt<'_, '_, '_>) -> Fingerprint {
         let HirId {
             owner,
             local_id: ItemLocalId(local_id),
index 638591eb1fb6977bd506fd46babad9642a687994..a09fd5df557f5df7ef941aaa86c0ec80a823be9a 100644 (file)
@@ -36,7 +36,7 @@ pub enum CrateNum {
 }
 
 impl ::std::fmt::Debug for CrateNum {
-    fn fmt(&self, fmt: &mut ::std::fmt::Formatter) -> ::std::fmt::Result {
+    fn fmt(&self, fmt: &mut ::std::fmt::Formatter<'_>) -> ::std::fmt::Result {
         match self {
             CrateNum::Index(id) => write!(fmt, "crate{}", id.private),
             CrateNum::Invalid => write!(fmt, "invalid crate"),
@@ -97,7 +97,7 @@ pub fn as_def_id(&self) -> DefId { DefId { krate: *self, index: CRATE_DEF_INDEX
 }
 
 impl fmt::Display for CrateNum {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self {
             CrateNum::Index(id) => fmt::Display::fmt(&id.private, f),
             CrateNum::Invalid => write!(f, "invalid crate"),
@@ -132,7 +132,7 @@ impl serialize::UseSpecializedDecodable for CrateNum {}
 pub const CRATE_DEF_INDEX: DefIndex = DefIndex(0);
 
 impl fmt::Debug for DefIndex {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f,
                "DefIndex({}:{})",
                self.address_space().index(),
@@ -224,7 +224,7 @@ pub struct DefId {
 }
 
 impl fmt::Debug for DefId {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "DefId({:?}/{}:{}",
                self.krate.index(),
                self.index.address_space().index(),
@@ -288,7 +288,7 @@ pub fn to_def_id(self) -> DefId {
 }
 
 impl fmt::Debug for LocalDefId {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         self.to_def_id().fmt(f)
     }
 }
index aa1bd6dd59ccf0e28d1ec9d7755b5ed576cb9195..62b06f54301f384acd344bf8bd836e8e9d173c58 100644 (file)
@@ -686,7 +686,7 @@ fn collect_in_band_defs<T, F>(
         f: F,
     ) -> (Vec<hir::GenericParam>, T)
     where
-        F: FnOnce(&mut LoweringContext) -> (Vec<hir::GenericParam>, T),
+        F: FnOnce(&mut LoweringContext<'_>) -> (Vec<hir::GenericParam>, T),
     {
         assert!(!self.is_collecting_in_band_lifetimes);
         assert!(self.lifetimes_to_define.is_empty());
@@ -788,7 +788,7 @@ fn collect_fresh_in_band_lifetime(&mut self, span: Span) -> ParamName {
     // for them.
     fn with_in_scope_lifetime_defs<T, F>(&mut self, params: &[GenericParam], f: F) -> T
     where
-        F: FnOnce(&mut LoweringContext) -> T,
+        F: FnOnce(&mut LoweringContext<'_>) -> T,
     {
         let old_len = self.in_scope_lifetimes.len();
         let lt_def_names = params.iter().filter_map(|param| match param.kind {
@@ -812,7 +812,7 @@ fn with_parent_impl_lifetime_defs<T, F>(&mut self,
         params: &HirVec<hir::GenericParam>,
         f: F
     ) -> T where
-        F: FnOnce(&mut LoweringContext) -> T,
+        F: FnOnce(&mut LoweringContext<'_>) -> T,
     {
         let old_len = self.in_scope_lifetimes.len();
         let lt_def_names = params.iter().filter_map(|param| match param.kind {
@@ -841,7 +841,7 @@ fn add_in_band_defs<F, T>(
         f: F,
     ) -> (hir::Generics, T)
     where
-        F: FnOnce(&mut LoweringContext, &mut Vec<hir::GenericParam>) -> T,
+        F: FnOnce(&mut LoweringContext<'_>, &mut Vec<hir::GenericParam>) -> T,
     {
         let (in_band_defs, (mut lowered_generics, res)) = self.with_in_scope_lifetime_defs(
             &generics.params,
@@ -870,7 +870,7 @@ fn add_in_band_defs<F, T>(
 
     fn with_catch_scope<T, F>(&mut self, catch_id: NodeId, f: F) -> T
     where
-        F: FnOnce(&mut LoweringContext) -> T,
+        F: FnOnce(&mut LoweringContext<'_>) -> T,
     {
         let len = self.catch_scopes.len();
         self.catch_scopes.push(catch_id);
@@ -892,7 +892,7 @@ fn make_async_expr(
         capture_clause: CaptureBy,
         closure_node_id: NodeId,
         ret_ty: Option<&Ty>,
-        body: impl FnOnce(&mut LoweringContext) -> hir::Expr,
+        body: impl FnOnce(&mut LoweringContext<'_>) -> hir::Expr,
     ) -> hir::ExprKind {
         let prev_is_generator = mem::replace(&mut self.is_generator, true);
         let body_expr = body(self);
@@ -929,7 +929,7 @@ fn make_async_expr(
 
     fn lower_body<F>(&mut self, decl: Option<&FnDecl>, f: F) -> hir::BodyId
     where
-        F: FnOnce(&mut LoweringContext) -> hir::Expr,
+        F: FnOnce(&mut LoweringContext<'_>) -> hir::Expr,
     {
         let prev = mem::replace(&mut self.is_generator, false);
         let result = f(self);
@@ -940,7 +940,7 @@ fn lower_body<F>(&mut self, decl: Option<&FnDecl>, f: F) -> hir::BodyId
 
     fn with_loop_scope<T, F>(&mut self, loop_id: NodeId, f: F) -> T
     where
-        F: FnOnce(&mut LoweringContext) -> T,
+        F: FnOnce(&mut LoweringContext<'_>) -> T,
     {
         // We're no longer in the base loop's condition; we're in another loop.
         let was_in_loop_condition = self.is_in_loop_condition;
@@ -965,7 +965,7 @@ fn with_loop_scope<T, F>(&mut self, loop_id: NodeId, f: F) -> T
 
     fn with_loop_condition_scope<T, F>(&mut self, f: F) -> T
     where
-        F: FnOnce(&mut LoweringContext) -> T,
+        F: FnOnce(&mut LoweringContext<'_>) -> T,
     {
         let was_in_loop_condition = self.is_in_loop_condition;
         self.is_in_loop_condition = true;
@@ -979,7 +979,7 @@ fn with_loop_condition_scope<T, F>(&mut self, f: F) -> T
 
     fn with_new_scopes<T, F>(&mut self, f: F) -> T
     where
-        F: FnOnce(&mut LoweringContext) -> T,
+        F: FnOnce(&mut LoweringContext<'_>) -> T,
     {
         let was_in_loop_condition = self.is_in_loop_condition;
         self.is_in_loop_condition = false;
@@ -1094,7 +1094,8 @@ fn lower_arm(&mut self, arm: &Arm) -> hir::Arm {
         }
     }
 
-    fn lower_ty_binding(&mut self, b: &TypeBinding, itctx: ImplTraitContext) -> hir::TypeBinding {
+    fn lower_ty_binding(&mut self, b: &TypeBinding,
+                        itctx: ImplTraitContext<'_>) -> hir::TypeBinding {
         hir::TypeBinding {
             id: self.lower_node_id(b.id).node_id,
             ident: b.ident,
@@ -1105,7 +1106,7 @@ fn lower_ty_binding(&mut self, b: &TypeBinding, itctx: ImplTraitContext) -> hir:
 
     fn lower_generic_arg(&mut self,
                         arg: &ast::GenericArg,
-                        itctx: ImplTraitContext)
+                        itctx: ImplTraitContext<'_>)
                         -> hir::GenericArg {
         match arg {
             ast::GenericArg::Lifetime(lt) => GenericArg::Lifetime(self.lower_lifetime(&lt)),
@@ -1113,11 +1114,11 @@ fn lower_generic_arg(&mut self,
         }
     }
 
-    fn lower_ty(&mut self, t: &Ty, itctx: ImplTraitContext) -> P<hir::Ty> {
+    fn lower_ty(&mut self, t: &Ty, itctx: ImplTraitContext<'_>) -> P<hir::Ty> {
         P(self.lower_ty_direct(t, itctx))
     }
 
-    fn lower_ty_direct(&mut self, t: &Ty, mut itctx: ImplTraitContext) -> hir::Ty {
+    fn lower_ty_direct(&mut self, t: &Ty, mut itctx: ImplTraitContext<'_>) -> hir::Ty {
         let kind = match t.node {
             TyKind::Infer => hir::TyKind::Infer,
             TyKind::Err => hir::TyKind::Err,
@@ -1289,7 +1290,7 @@ fn lower_existential_impl_trait(
         span: Span,
         fn_def_id: Option<DefId>,
         exist_ty_node_id: NodeId,
-        lower_bounds: impl FnOnce(&mut LoweringContext) -> hir::GenericBounds,
+        lower_bounds: impl FnOnce(&mut LoweringContext<'_>) -> hir::GenericBounds,
     ) -> hir::TyKind {
         // Make sure we know that some funky desugaring has been going on here.
         // This is a first: there is code in other places like for loop
@@ -1567,7 +1568,7 @@ fn lower_qpath(
         qself: &Option<QSelf>,
         p: &Path,
         param_mode: ParamMode,
-        mut itctx: ImplTraitContext,
+        mut itctx: ImplTraitContext<'_>,
     ) -> hir::QPath {
         let qself_position = qself.as_ref().map(|q| q.position);
         let qself = qself.as_ref().map(|q| self.lower_ty(&q.ty, itctx.reborrow()));
@@ -1762,7 +1763,7 @@ fn lower_path_segment(
         param_mode: ParamMode,
         expected_lifetimes: usize,
         parenthesized_generic_args: ParenthesizedGenericArgs,
-        itctx: ImplTraitContext,
+        itctx: ImplTraitContext<'_>,
     ) -> hir::PathSegment {
         let (mut generic_args, infer_types) = if let Some(ref generic_args) = segment.args {
             let msg = "parenthesized parameters may only be used with a trait";
@@ -1844,7 +1845,7 @@ fn lower_angle_bracketed_parameter_data(
         &mut self,
         data: &AngleBracketedArgs,
         param_mode: ParamMode,
-        mut itctx: ImplTraitContext,
+        mut itctx: ImplTraitContext<'_>,
     ) -> (hir::GenericArgs, bool) {
         let &AngleBracketedArgs { ref args, ref bindings, .. } = data;
         let has_types = args.iter().any(|arg| match arg {
@@ -1871,7 +1872,7 @@ fn lower_parenthesized_parameter_data(
         self.with_anonymous_lifetime_mode(
             AnonymousLifetimeMode::PassThrough,
             |this| {
-                const DISALLOWED: ImplTraitContext = ImplTraitContext::Disallowed;
+                const DISALLOWED: ImplTraitContext<'_> = ImplTraitContext::Disallowed;
                 let &ParenthesisedArgs { ref inputs, ref output, span } = data;
                 let inputs = inputs.iter().map(|ty| this.lower_ty_direct(ty, DISALLOWED)).collect();
                 let mk_tup = |this: &mut Self, tys, span| {
@@ -2250,7 +2251,7 @@ fn visit_lifetime(&mut self, lifetime: &'v hir::Lifetime) {
     fn lower_param_bound(
         &mut self,
         tpb: &GenericBound,
-        itctx: ImplTraitContext,
+        itctx: ImplTraitContext<'_>,
     ) -> hir::GenericBound {
         match *tpb {
             GenericBound::Trait(ref ty, modifier) => hir::GenericBound::Trait(
@@ -2304,7 +2305,7 @@ fn lower_generic_params(
         &mut self,
         params: &[GenericParam],
         add_bounds: &NodeMap<Vec<GenericBound>>,
-        mut itctx: ImplTraitContext,
+        mut itctx: ImplTraitContext<'_>,
     ) -> hir::HirVec<hir::GenericParam> {
         params.iter().map(|param| {
             self.lower_generic_param(param, add_bounds, itctx.reborrow())
@@ -2314,7 +2315,7 @@ fn lower_generic_params(
     fn lower_generic_param(&mut self,
                            param: &GenericParam,
                            add_bounds: &NodeMap<Vec<GenericBound>>,
-                           mut itctx: ImplTraitContext)
+                           mut itctx: ImplTraitContext<'_>)
                            -> hir::GenericParam {
         let mut bounds = self.lower_param_bounds(&param.bounds, itctx.reborrow());
         match param.kind {
@@ -2383,7 +2384,7 @@ fn lower_generic_param(&mut self,
     fn lower_generics(
         &mut self,
         generics: &Generics,
-        itctx: ImplTraitContext)
+        itctx: ImplTraitContext<'_>)
         -> hir::Generics
     {
         // Collect `?Trait` bounds in where clause and move them to parameter definitions.
@@ -2536,7 +2537,7 @@ fn lower_variant_data(&mut self, vdata: &VariantData) -> hir::VariantData {
         }
     }
 
-    fn lower_trait_ref(&mut self, p: &TraitRef, itctx: ImplTraitContext) -> hir::TraitRef {
+    fn lower_trait_ref(&mut self, p: &TraitRef, itctx: ImplTraitContext<'_>) -> hir::TraitRef {
         let path = match self.lower_qpath(p.ref_id, &None, &p.path, ParamMode::Explicit, itctx) {
             hir::QPath::Resolved(None, path) => path.and_then(|path| path),
             qpath => bug!("lower_trait_ref: unexpected QPath `{:?}`", qpath),
@@ -2552,7 +2553,7 @@ fn lower_trait_ref(&mut self, p: &TraitRef, itctx: ImplTraitContext) -> hir::Tra
     fn lower_poly_trait_ref(
         &mut self,
         p: &PolyTraitRef,
-        mut itctx: ImplTraitContext,
+        mut itctx: ImplTraitContext<'_>,
     ) -> hir::PolyTraitRef {
         let bound_generic_params =
             self.lower_generic_params(&p.bound_generic_params, &NodeMap(), itctx.reborrow());
@@ -2593,14 +2594,14 @@ fn lower_field(&mut self, f: &Field) -> hir::Field {
         }
     }
 
-    fn lower_mt(&mut self, mt: &MutTy, itctx: ImplTraitContext) -> hir::MutTy {
+    fn lower_mt(&mut self, mt: &MutTy, itctx: ImplTraitContext<'_>) -> hir::MutTy {
         hir::MutTy {
             ty: self.lower_ty(&mt.ty, itctx),
             mutbl: self.lower_mutability(mt.mutbl),
         }
     }
 
-    fn lower_param_bounds(&mut self, bounds: &[GenericBound], mut itctx: ImplTraitContext)
+    fn lower_param_bounds(&mut self, bounds: &[GenericBound], mut itctx: ImplTraitContext<'_>)
         -> hir::GenericBounds {
         bounds.iter().map(|bound| self.lower_param_bound(bound, itctx.reborrow())).collect()
     }
index c7824d411aac6366bf745568a31d88ec5832866f..69706aabcb0505b26ac9260652ed3e5006dee4dd 100644 (file)
@@ -143,7 +143,7 @@ fn new(d: &'a FnDecl, b: ast::BodyId, id: NodeId, s: Span, attrs: &'a [Attribute
 
 impl<'a> FnLikeNode<'a> {
     /// Attempts to construct a FnLikeNode from presumed FnLike node input.
-    pub fn from_node(node: Node) -> Option<FnLikeNode> {
+    pub fn from_node(node: Node<'_>) -> Option<FnLikeNode<'_>> {
         let fn_like = match node {
             map::Node::Item(item) => item.is_fn_like(),
             map::Node::TraitItem(tm) => tm.is_fn_like(),
@@ -173,15 +173,15 @@ pub fn decl(self) -> &'a FnDecl {
     }
 
     pub fn span(self) -> Span {
-        self.handle(|i: ItemFnParts| i.span,
+        self.handle(|i: ItemFnParts<'_>| i.span,
                     |_, _, _: &'a ast::MethodSig, _, _, span, _| span,
-                    |c: ClosureParts| c.span)
+                    |c: ClosureParts<'_>| c.span)
     }
 
     pub fn id(self) -> NodeId {
-        self.handle(|i: ItemFnParts| i.id,
+        self.handle(|i: ItemFnParts<'_>| i.id,
                     |id, _, _: &'a ast::MethodSig, _, _, _, _| id,
-                    |c: ClosureParts| c.id)
+                    |c: ClosureParts<'_>| c.id)
     }
 
     pub fn constness(self) -> ast::Constness {
index 6e35755d9a4ec228d93024ef5f4c56fe123309d5..f5f9bcd3b5ea5125d32e70cd09a2028e57dd2266 100644 (file)
@@ -668,7 +668,7 @@ fn walk_parent_nodes<F, F2>(&self,
     /// }
     /// ```
     pub fn get_return_block(&self, id: NodeId) -> Option<NodeId> {
-        let match_fn = |node: &Node| {
+        let match_fn = |node: &Node<'_>| {
             match *node {
                 Node::Item(_) |
                 Node::ForeignItem(_) |
@@ -677,7 +677,7 @@ pub fn get_return_block(&self, id: NodeId) -> Option<NodeId> {
                 _ => false,
             }
         };
-        let match_non_returning_block = |node: &Node| {
+        let match_non_returning_block = |node: &Node<'_>| {
             match *node {
                 Node::Expr(ref expr) => {
                     match expr.node {
@@ -954,7 +954,7 @@ fn suffix_matches(&self, parent: NodeId) -> bool {
         // If `id` itself is a mod named `m` with parent `p`, then
         // returns `Some(id, m, p)`.  If `id` has no mod in its parent
         // chain, then returns `None`.
-        fn find_first_mod_parent<'a>(map: &'a Map, mut id: NodeId) -> Option<(NodeId, Name)> {
+        fn find_first_mod_parent<'a>(map: &'a Map<'_>, mut id: NodeId) -> Option<(NodeId, Name)> {
             loop {
                 if let Node::Item(item) = map.find(id)? {
                     if item_is_mod(&item) {
@@ -1076,7 +1076,7 @@ pub fn map_crate<'hir>(sess: &::session::Session,
 /// Identical to the `PpAnn` implementation for `hir::Crate`,
 /// except it avoids creating a dependency on the whole crate.
 impl<'hir> print::PpAnn for Map<'hir> {
-    fn nested(&self, state: &mut print::State, nested: print::Nested) -> io::Result<()> {
+    fn nested(&self, state: &mut print::State<'_>, nested: print::Nested) -> io::Result<()> {
         match nested {
             Nested::Item(id) => state.print_item(self.expect_item(id.id)),
             Nested::TraitItem(id) => state.print_trait_item(self.trait_item(id)),
@@ -1088,7 +1088,7 @@ fn nested(&self, state: &mut print::State, nested: print::Nested) -> io::Result<
 }
 
 impl<'a> print::State<'a> {
-    pub fn print_node(&mut self, node: Node) -> io::Result<()> {
+    pub fn print_node(&mut self, node: Node<'_>) -> io::Result<()> {
         match node {
             Node::Item(a)         => self.print_item(&a),
             Node::ForeignItem(a)  => self.print_foreign_item(&a),
@@ -1126,7 +1126,7 @@ pub fn print_node(&mut self, node: Node) -> io::Result<()> {
     }
 }
 
-fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
+fn node_id_to_string(map: &Map<'_>, id: NodeId, include_id: bool) -> String {
     let id_str = format!(" (id={})", id);
     let id_str = if include_id { &id_str[..] } else { "" };
 
@@ -1253,7 +1253,7 @@ fn node_id_to_string(map: &Map, id: NodeId, include_id: bool) -> String {
     }
 }
 
-pub fn describe_def(tcx: TyCtxt, def_id: DefId) -> Option<Def> {
+pub fn describe_def(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Option<Def> {
     if let Some(node_id) = tcx.hir.as_local_node_id(def_id) {
         tcx.hir.describe_def(node_id)
     } else {
index de9808ffe7001b66abfb0faaa23886d8a6a76902..088bee38116809228d1ec2edd2fdc9fbf97020fe 100644 (file)
@@ -170,7 +170,7 @@ pub struct Label {
 }
 
 impl fmt::Debug for Label {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "label({:?})", self.ident)
     }
 }
@@ -277,13 +277,13 @@ pub fn modern(&self) -> LifetimeName {
 }
 
 impl fmt::Display for Lifetime {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         self.name.ident().fmt(f)
     }
 }
 
 impl fmt::Debug for Lifetime {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f,
                "lifetime({}: {})",
                self.id,
@@ -320,13 +320,13 @@ pub fn is_global(&self) -> bool {
 }
 
 impl fmt::Debug for Path {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "path({})", print::to_string(print::NO_ANN, |s| s.print_path(self, false)))
     }
 }
 
 impl fmt::Display for Path {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{}", print::to_string(print::NO_ANN, |s| s.print_path(self, false)))
     }
 }
@@ -804,7 +804,7 @@ pub struct Pat {
 }
 
 impl fmt::Debug for Pat {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "pat({}: {})", self.id,
                print::to_string(print::NO_ANN, |s| s.print_pat(self)))
     }
@@ -1120,7 +1120,7 @@ pub fn is_by_value(self) -> bool {
 pub type Stmt = Spanned<StmtKind>;
 
 impl fmt::Debug for StmtKind {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         // Sadness.
         let spanned = source_map::dummy_spanned(self.clone());
         write!(f,
@@ -1348,7 +1348,7 @@ pub fn precedence(&self) -> ExprPrecedence {
 }
 
 impl fmt::Debug for Expr {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "expr({}: {})", self.id,
                print::to_string(print::NO_ANN, |s| s.print_expr(self)))
     }
@@ -1521,7 +1521,7 @@ pub enum LoopIdError {
 }
 
 impl fmt::Display for LoopIdError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt::Display::fmt(match *self {
             LoopIdError::OutsideLoopScope => "not inside loop scope",
             LoopIdError::UnlabeledCfInWhileCondition =>
@@ -1668,7 +1668,7 @@ pub struct Ty {
 }
 
 impl fmt::Debug for Ty {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "type({})",
                print::to_string(print::NO_ANN, |s| s.print_type(self)))
     }
@@ -1826,7 +1826,7 @@ pub fn is_default(&self) -> bool {
 }
 
 impl fmt::Display for Unsafety {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt::Display::fmt(match *self {
                               Unsafety::Normal => "normal",
                               Unsafety::Unsafe => "unsafe",
@@ -1844,7 +1844,7 @@ pub enum ImplPolarity {
 }
 
 impl fmt::Debug for ImplPolarity {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             ImplPolarity::Positive => "positive".fmt(f),
             ImplPolarity::Negative => "negative".fmt(f),
@@ -2284,7 +2284,8 @@ pub struct TraitCandidate {
 // imported.
 pub type GlobMap = NodeMap<FxHashSet<Name>>;
 
-pub fn provide(providers: &mut Providers) {
+
+pub fn provide(providers: &mut Providers<'_>) {
     providers.describe_def = map::describe_def;
 }
 
index 7638a2cc140c732f6e05ef7794ce075abc684f84..69699d2e4acd35f9f5dd3e8fb2678f096730902d 100644 (file)
@@ -48,13 +48,13 @@ pub enum Nested {
 }
 
 pub trait PpAnn {
-    fn nested(&self, _state: &mut State, _nested: Nested) -> io::Result<()> {
+    fn nested(&self, _state: &mut State<'_>, _nested: Nested) -> io::Result<()> {
         Ok(())
     }
-    fn pre(&self, _state: &mut State, _node: AnnNode) -> io::Result<()> {
+    fn pre(&self, _state: &mut State<'_>, _node: AnnNode<'_>) -> io::Result<()> {
         Ok(())
     }
-    fn post(&self, _state: &mut State, _node: AnnNode) -> io::Result<()> {
+    fn post(&self, _state: &mut State<'_>, _node: AnnNode<'_>) -> io::Result<()> {
         Ok(())
     }
     fn try_fetch_item(&self, _: ast::NodeId) -> Option<&hir::Item> {
@@ -70,7 +70,7 @@ impl PpAnn for hir::Crate {
     fn try_fetch_item(&self, item: ast::NodeId) -> Option<&hir::Item> {
         Some(self.item(item))
     }
-    fn nested(&self, state: &mut State, nested: Nested) -> io::Result<()> {
+    fn nested(&self, state: &mut State<'_>, nested: Nested) -> io::Result<()> {
         match nested {
             Nested::Item(id) => state.print_item(self.item(id.id)),
             Nested::TraitItem(id) => state.print_trait_item(self.trait_item(id)),
@@ -190,7 +190,7 @@ pub fn new(cm: &'a SourceMap,
 }
 
 pub fn to_string<F>(ann: &dyn PpAnn, f: F) -> String
-    where F: FnOnce(&mut State) -> io::Result<()>
+    where F: FnOnce(&mut State<'_>) -> io::Result<()>
 {
     let mut wr = Vec::new();
     {
@@ -314,7 +314,7 @@ pub fn commasep_cmnt<T, F, G>(&mut self,
                                   mut op: F,
                                   mut get_span: G)
                                   -> io::Result<()>
-        where F: FnMut(&mut State, &T) -> io::Result<()>,
+        where F: FnMut(&mut State<'_>, &T) -> io::Result<()>,
               G: FnMut(&T) -> syntax_pos::Span
     {
         self.rbox(0, b)?;
index e3bbdab4fd9659db1a3b0f64fc82f2e397045684..09059090e2e35421c5dd9f3104dd89388b3b57a9 100644 (file)
@@ -82,7 +82,7 @@ impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
     pub fn note_and_explain_region(
         self,
         region_scope_tree: &region::ScopeTree,
-        err: &mut DiagnosticBuilder,
+        err: &mut DiagnosticBuilder<'_>,
         prefix: &str,
         region: ty::Region<'tcx>,
         suffix: &str,
@@ -162,7 +162,7 @@ pub fn note_and_explain_region(
 
     pub fn note_and_explain_free_region(
         self,
-        err: &mut DiagnosticBuilder,
+        err: &mut DiagnosticBuilder<'_>,
         prefix: &str,
         region: ty::Region<'tcx>,
         suffix: &str,
@@ -242,7 +242,7 @@ fn msg_span_from_early_bound_and_free_regions(
     }
 
     fn emit_msg_span(
-        err: &mut DiagnosticBuilder,
+        err: &mut DiagnosticBuilder<'_>,
         prefix: &str,
         description: String,
         span: Option<Span>,
@@ -424,11 +424,11 @@ fn process_errors(
     /// Adds a note if the types come from similarly named crates
     fn check_and_note_conflicting_crates(
         &self,
-        err: &mut DiagnosticBuilder,
+        err: &mut DiagnosticBuilder<'_>,
         terr: &TypeError<'tcx>,
         sp: Span,
     ) {
-        let report_path_match = |err: &mut DiagnosticBuilder, did1: DefId, did2: DefId| {
+        let report_path_match = |err: &mut DiagnosticBuilder<'_>, did1: DefId, did2: DefId| {
             // Only external crates, if either is from a local
             // module we could have false positives
             if !(did1.is_local() || did2.is_local()) && did1.krate != did2.krate {
@@ -750,7 +750,7 @@ fn push_ty_ref<'tcx>(
                         values.1.push_normal("<");
                     }
 
-                    fn lifetime_display(lifetime: Region) -> String {
+                    fn lifetime_display(lifetime: Region<'_>) -> String {
                         let s = lifetime.to_string();
                         if s.is_empty() {
                             "'_".to_string()
index afc50fe1151665e3a37fb37549644f74013d5344..a6efb5e678332fc24d11e9115f850944ee70ca6a 100644 (file)
@@ -50,7 +50,7 @@ pub(super) fn find_arg_with_region(
         &self,
         anon_region: Region<'tcx>,
         replace_region: Region<'tcx>,
-    ) -> Option<AnonymousArgInfo> {
+    ) -> Option<AnonymousArgInfo<'_>> {
         let (id, bound_region) = match *anon_region {
             ty::ReFree(ref free_region) => (free_region.scope, free_region.bound_region),
             ty::ReEarlyBound(ref ebr) => (
index 02ec9fe74c1fe693bf5c24e60da393c93c170266..54d01a035a8bee3a4750edef2435dae97b412f6f 100644 (file)
@@ -16,7 +16,7 @@
 
 impl<'a, 'gcx, 'tcx> InferCtxt<'a, 'gcx, 'tcx> {
     pub(super) fn note_region_origin(&self,
-                                     err: &mut DiagnosticBuilder,
+                                     err: &mut DiagnosticBuilder<'_>,
                                      origin: &SubregionOrigin<'tcx>) {
         match *origin {
             infer::Subtype(ref trace) => {
index bb1c9448132c117b72656f91fe0e871c36d1e555..fae48325371562fabd0adf7eb6b6e9c59445ccbd 100644 (file)
@@ -450,7 +450,7 @@ fn var_ids<'a, 'gcx, 'tcx>(fields: &CombineFields<'a, 'gcx, 'tcx>,
        .collect()
 }
 
-fn is_var_in_set(new_vars: &[ty::RegionVid], r: ty::Region) -> bool {
+fn is_var_in_set(new_vars: &[ty::RegionVid], r: ty::Region<'_>) -> bool {
     match *r {
         ty::ReVar(ref v) => new_vars.iter().any(|x| x == v),
         _ => false
index bdd3f78aff3ebf37698c4ad6df90324a410d8d65..3f17c9bb020ef11c8e288acd1a724452ddace469 100644 (file)
@@ -178,10 +178,10 @@ fn new(name: String,
 impl<'a, 'gcx, 'tcx> dot::Labeller<'a> for ConstraintGraph<'a, 'gcx, 'tcx> {
     type Node = Node;
     type Edge = Edge<'tcx>;
-    fn graph_id(&self) -> dot::Id {
+    fn graph_id(&self) -> dot::Id<'_> {
         dot::Id::new(&*self.graph_name).unwrap()
     }
-    fn node_id(&self, n: &Node) -> dot::Id {
+    fn node_id(&self, n: &Node) -> dot::Id<'_> {
         let node_id = match self.node_ids.get(n) {
             Some(node_id) => node_id,
             None => bug!("no node_id found for node: {:?}", n),
@@ -194,13 +194,13 @@ fn node_id(&self, n: &Node) -> dot::Id {
             }
         }
     }
-    fn node_label(&self, n: &Node) -> dot::LabelText {
+    fn node_label(&self, n: &Node) -> dot::LabelText<'_> {
         match *n {
             Node::RegionVid(n_vid) => dot::LabelText::label(format!("{:?}", n_vid)),
             Node::Region(n_rgn) => dot::LabelText::label(format!("{:?}", n_rgn)),
         }
     }
-    fn edge_label(&self, e: &Edge) -> dot::LabelText {
+    fn edge_label(&self, e: &Edge<'_>) -> dot::LabelText<'_> {
         match *e {
             Edge::Constraint(ref c) =>
                 dot::LabelText::label(format!("{:?}", self.map.get(c).unwrap())),
@@ -209,7 +209,7 @@ fn edge_label(&self, e: &Edge) -> dot::LabelText {
     }
 }
 
-fn constraint_to_nodes(c: &Constraint) -> (Node, Node) {
+fn constraint_to_nodes(c: &Constraint<'_>) -> (Node, Node) {
     match *c {
         Constraint::VarSubVar(rv_1, rv_2) =>
             (Node::RegionVid(rv_1), Node::RegionVid(rv_2)),
@@ -222,7 +222,7 @@ fn constraint_to_nodes(c: &Constraint) -> (Node, Node) {
     }
 }
 
-fn edge_to_nodes(e: &Edge) -> (Node, Node) {
+fn edge_to_nodes(e: &Edge<'_>) -> (Node, Node) {
     match *e {
         Edge::Constraint(ref c) => constraint_to_nodes(c),
         Edge::EnclScope(sub, sup) => {
@@ -235,7 +235,7 @@ fn edge_to_nodes(e: &Edge) -> (Node, Node) {
 impl<'a, 'gcx, 'tcx> dot::GraphWalk<'a> for ConstraintGraph<'a, 'gcx, 'tcx> {
     type Node = Node;
     type Edge = Edge<'tcx>;
-    fn nodes(&self) -> dot::Nodes<Node> {
+    fn nodes(&self) -> dot::Nodes<'_, Node> {
         let mut set = FxHashSet();
         for node in self.node_ids.keys() {
             set.insert(*node);
@@ -243,7 +243,7 @@ fn nodes(&self) -> dot::Nodes<Node> {
         debug!("constraint graph has {} nodes", set.len());
         set.into_iter().collect()
     }
-    fn edges(&self) -> dot::Edges<Edge<'tcx>> {
+    fn edges(&self) -> dot::Edges<'_, Edge<'tcx>> {
         debug!("constraint graph has {} edges", self.map.len());
         let mut v: Vec<_> = self.map.keys().map(|e| Edge::Constraint(*e)).collect();
         self.region_rels.region_scope_tree.each_encl_scope(|sub, sup| {
index a8fbfc3b64dfd1e1d63ec40bc02b415bc3bdf882..2046f66f99f66c91ed4086adb5445e15ff4a2b35 100644 (file)
@@ -163,7 +163,7 @@ fn dump_constraints(&self, free_regions: &RegionRelations<'_, '_, 'tcx>) {
         }
     }
 
-    fn expand_givens(&mut self, graph: &RegionGraph) {
+    fn expand_givens(&mut self, graph: &RegionGraph<'_>) {
         // Givens are a kind of horrible hack to account for
         // constraints like 'c <= '0 that are known to hold due to
         // closure signatures (see the comment above on the `givens`
@@ -558,7 +558,7 @@ fn collect_error_for_expanding_node(
         // We place free regions first because we are special casing
         // SubSupConflict(ReFree, ReFree) when reporting error, and so
         // the user will more likely get a specific suggestion.
-        fn region_order_key(x: &RegionAndOrigin) -> u8 {
+        fn region_order_key(x: &RegionAndOrigin<'_>) -> u8 {
             match *x.region {
                 ReEarlyBound(_) => 0,
                 ReFree(_) => 1,
@@ -739,7 +739,7 @@ fn bound_is_met(
 }
 
 impl<'tcx> fmt::Debug for RegionAndOrigin<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "RegionAndOrigin({:?},{:?})", self.region, self.origin)
     }
 }
index dc10ec03feef04c1ae2056b3ad28dc2fe637487e..0407e8ace5acccb72a037908d900337ba44ac56b 100644 (file)
@@ -445,7 +445,7 @@ pub struct RegionObligation<'tcx> {
 }
 
 impl fmt::Display for FixupError {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         use self::FixupError::*;
 
         match *self {
@@ -590,7 +590,7 @@ pub fn freshen<T: TypeFoldable<'tcx>>(&self, t: T) -> T {
         t.fold_with(&mut self.freshener())
     }
 
-    pub fn type_var_diverges(&'a self, ty: Ty) -> bool {
+    pub fn type_var_diverges(&'a self, ty: Ty<'_>) -> bool {
         match ty.sty {
             ty::Infer(ty::TyVar(vid)) => self.type_variables.borrow().var_diverges(vid),
             _ => false,
@@ -601,7 +601,7 @@ pub fn freshener<'b>(&'b self) -> TypeFreshener<'b, 'gcx, 'tcx> {
         freshen::TypeFreshener::new(self)
     }
 
-    pub fn type_is_unconstrained_numeric(&'a self, ty: Ty) -> UnconstrainedNumeric {
+    pub fn type_is_unconstrained_numeric(&'a self, ty: Ty<'_>) -> UnconstrainedNumeric {
         use ty::error::UnconstrainedNumeric::Neither;
         use ty::error::UnconstrainedNumeric::{UnconstrainedFloat, UnconstrainedInt};
         match ty.sty {
@@ -1510,7 +1510,7 @@ pub fn dummy(tcx: TyCtxt<'a, 'gcx, 'tcx>) -> TypeTrace<'tcx> {
 }
 
 impl<'tcx> fmt::Debug for TypeTrace<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "TypeTrace({:?})", self.cause)
     }
 }
@@ -1598,7 +1598,7 @@ impl<'tcx> TypeFoldable<'tcx> for ValuePairs<'tcx> {
 }
 
 impl<'tcx> fmt::Debug for RegionObligation<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "RegionObligation(sub_region={:?}, sup_type={:?})",
index 88d375742670d2e68dbfe0b2f4d44842328b18b6..e5220aad0562e0273da036e10916a0d49262ba76 100644 (file)
@@ -841,7 +841,7 @@ fn fold_opaque_ty(
 /// We will return true if the reference is within the same module as the existential type
 /// So true for f1, false for f2.
 pub fn may_define_existential_type(
-    tcx: TyCtxt,
+    tcx: TyCtxt<'_, '_, '_>,
     def_id: DefId,
     opaque_node_id: ast::NodeId,
 ) -> bool {
index 6163ec1642001f603e4a7e53690596652a53a77f..e19ecfd427beccbb22c61ffb85cbd00365be3349 100644 (file)
@@ -84,14 +84,14 @@ fn sub_free_regions(&self,
     }
 }
 
-fn is_free(r: Region) -> bool {
+fn is_free(r: Region<'_>) -> bool {
     match *r {
         ty::ReEarlyBound(_) | ty::ReFree(_) => true,
         _ => false
     }
 }
 
-fn is_free_or_static(r: Region) -> bool {
+fn is_free_or_static(r: Region<'_>) -> bool {
     match *r {
         ty::ReStatic => true,
         _ => is_free(r),
index bc9027a08258c944d91223de0111f96238ae8a66..95893a7117892c4a7d45dfacd57b66fe5063ec6b 100644 (file)
@@ -914,13 +914,13 @@ pub fn tainted(
 }
 
 impl fmt::Debug for RegionSnapshot {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "RegionSnapshot(length={})", self.length)
     }
 }
 
 impl<'tcx> fmt::Debug for GenericKind<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             GenericKind::Param(ref p) => write!(f, "{:?}", p),
             GenericKind::Projection(ref p) => write!(f, "{:?}", p),
@@ -929,7 +929,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for GenericKind<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             GenericKind::Param(ref p) => write!(f, "{}", p),
             GenericKind::Projection(ref p) => write!(f, "{}", p),
index b8731e5bb03d55f3adfd0d75accbdac08cb6651d..0ac9d415756308030a7f2d457c8b37caf3acf642 100644 (file)
@@ -74,6 +74,8 @@
 
 #![recursion_limit="512"]
 
+#![warn(elided_lifetimes_in_paths)]
+
 extern crate arena;
 #[macro_use] extern crate bitflags;
 extern crate core;
index 38ec414fda9e383c9c91ee9a719d036fba52ba24..64056ece987706e566e5f539b2adc98a93f73571 100644 (file)
@@ -432,7 +432,7 @@ pub enum BuiltinLintDiagnostics {
 }
 
 impl BuiltinLintDiagnostics {
-    pub fn run(self, sess: &Session, db: &mut DiagnosticBuilder) {
+    pub fn run(self, sess: &Session, db: &mut DiagnosticBuilder<'_>) {
         match self {
             BuiltinLintDiagnostics::Normal => (),
             BuiltinLintDiagnostics::BareTraitObject(span, is_global) => {
index e22792305a0532c4991c03e67b69a621dfdf7550..0633286e39838f3a85ee41442f17dae37a4a8fa0 100644 (file)
@@ -355,7 +355,7 @@ pub fn check_lint_name(
         &self,
         lint_name: &str,
         tool_name: Option<LocalInternedString>,
-    ) -> CheckLintNameResult {
+    ) -> CheckLintNameResult<'_> {
         let complete_name = if let Some(tool_name) = tool_name {
             format!("{}::{}", tool_name, lint_name)
         } else {
@@ -410,7 +410,7 @@ fn check_tool_name_for_backwards_compat(
         &self,
         lint_name: &str,
         tool_name: &str,
-    ) -> CheckLintNameResult {
+    ) -> CheckLintNameResult<'_> {
         let complete_name = format!("{}::{}", tool_name, lint_name);
         match self.by_name.get(&complete_name) {
             None => match self.lint_groups.get(&*complete_name) {
@@ -525,7 +525,7 @@ fn lookup<S: Into<MultiSpan>>(&self,
                                   lint: &'static Lint,
                                   span: Option<S>,
                                   msg: &str)
-                                  -> DiagnosticBuilder;
+                                  -> DiagnosticBuilder<'_>;
 
     /// Emit a lint at the appropriate level, for a particular span.
     fn span_lint<S: Into<MultiSpan>>(&self, lint: &'static Lint, span: S, msg: &str) {
@@ -536,7 +536,7 @@ fn struct_span_lint<S: Into<MultiSpan>>(&self,
                                             lint: &'static Lint,
                                             span: S,
                                             msg: &str)
-                                            -> DiagnosticBuilder {
+                                            -> DiagnosticBuilder<'_> {
         self.lookup(lint, Some(span), msg)
     }
 
@@ -640,7 +640,7 @@ fn lookup<S: Into<MultiSpan>>(&self,
                                   lint: &'static Lint,
                                   span: Option<S>,
                                   msg: &str)
-                                  -> DiagnosticBuilder {
+                                  -> DiagnosticBuilder<'_> {
         let id = self.last_ast_node_with_lint_attrs;
         match span {
             Some(s) => self.tcx.struct_span_lint_node(lint, id, s, msg),
@@ -697,7 +697,7 @@ fn lookup<S: Into<MultiSpan>>(&self,
                                   lint: &'static Lint,
                                   span: Option<S>,
                                   msg: &str)
-                                  -> DiagnosticBuilder {
+                                  -> DiagnosticBuilder<'_> {
         self.builder.struct_lint(lint, span.map(|s| s.into()), msg)
     }
 
index 336ebe79d33abd7276eb6d20f6f427be9f82b04b..80365a56102126ad892e6acc4d1011333239e826 100644 (file)
@@ -54,7 +54,7 @@ pub fn new(sess: &Session) -> LintLevelSets {
         return me
     }
 
-    pub fn builder(sess: &Session) -> LintLevelsBuilder {
+    pub fn builder(sess: &Session) -> LintLevelsBuilder<'_> {
         LintLevelsBuilder::new(sess, LintLevelSets::new(sess))
     }
 
index 8d2851d1b77442403e9604969d22e8c8dcc6cf4d..3327b117d60560822d849bb3f313c03af0a89440 100644 (file)
@@ -327,56 +327,56 @@ fn get_lints(&self) -> LintArray {
 }
 
 pub trait EarlyLintPass: LintPass {
-    fn check_ident(&mut self, _: &EarlyContext, _: ast::Ident) { }
-    fn check_crate(&mut self, _: &EarlyContext, _: &ast::Crate) { }
-    fn check_crate_post(&mut self, _: &EarlyContext, _: &ast::Crate) { }
-    fn check_mod(&mut self, _: &EarlyContext, _: &ast::Mod, _: Span, _: ast::NodeId) { }
-    fn check_mod_post(&mut self, _: &EarlyContext, _: &ast::Mod, _: Span, _: ast::NodeId) { }
-    fn check_foreign_item(&mut self, _: &EarlyContext, _: &ast::ForeignItem) { }
-    fn check_foreign_item_post(&mut self, _: &EarlyContext, _: &ast::ForeignItem) { }
-    fn check_item(&mut self, _: &EarlyContext, _: &ast::Item) { }
-    fn check_item_post(&mut self, _: &EarlyContext, _: &ast::Item) { }
-    fn check_local(&mut self, _: &EarlyContext, _: &ast::Local) { }
-    fn check_block(&mut self, _: &EarlyContext, _: &ast::Block) { }
-    fn check_block_post(&mut self, _: &EarlyContext, _: &ast::Block) { }
-    fn check_stmt(&mut self, _: &EarlyContext, _: &ast::Stmt) { }
-    fn check_arm(&mut self, _: &EarlyContext, _: &ast::Arm) { }
-    fn check_pat(&mut self, _: &EarlyContext, _: &ast::Pat) { }
-    fn check_expr(&mut self, _: &EarlyContext, _: &ast::Expr) { }
-    fn check_expr_post(&mut self, _: &EarlyContext, _: &ast::Expr) { }
-    fn check_ty(&mut self, _: &EarlyContext, _: &ast::Ty) { }
-    fn check_generic_param(&mut self, _: &EarlyContext, _: &ast::GenericParam) { }
-    fn check_generics(&mut self, _: &EarlyContext, _: &ast::Generics) { }
-    fn check_where_predicate(&mut self, _: &EarlyContext, _: &ast::WherePredicate) { }
-    fn check_poly_trait_ref(&mut self, _: &EarlyContext, _: &ast::PolyTraitRef,
+    fn check_ident(&mut self, _: &EarlyContext<'_>, _: ast::Ident) { }
+    fn check_crate(&mut self, _: &EarlyContext<'_>, _: &ast::Crate) { }
+    fn check_crate_post(&mut self, _: &EarlyContext<'_>, _: &ast::Crate) { }
+    fn check_mod(&mut self, _: &EarlyContext<'_>, _: &ast::Mod, _: Span, _: ast::NodeId) { }
+    fn check_mod_post(&mut self, _: &EarlyContext<'_>, _: &ast::Mod, _: Span, _: ast::NodeId) { }
+    fn check_foreign_item(&mut self, _: &EarlyContext<'_>, _: &ast::ForeignItem) { }
+    fn check_foreign_item_post(&mut self, _: &EarlyContext<'_>, _: &ast::ForeignItem) { }
+    fn check_item(&mut self, _: &EarlyContext<'_>, _: &ast::Item) { }
+    fn check_item_post(&mut self, _: &EarlyContext<'_>, _: &ast::Item) { }
+    fn check_local(&mut self, _: &EarlyContext<'_>, _: &ast::Local) { }
+    fn check_block(&mut self, _: &EarlyContext<'_>, _: &ast::Block) { }
+    fn check_block_post(&mut self, _: &EarlyContext<'_>, _: &ast::Block) { }
+    fn check_stmt(&mut self, _: &EarlyContext<'_>, _: &ast::Stmt) { }
+    fn check_arm(&mut self, _: &EarlyContext<'_>, _: &ast::Arm) { }
+    fn check_pat(&mut self, _: &EarlyContext<'_>, _: &ast::Pat) { }
+    fn check_expr(&mut self, _: &EarlyContext<'_>, _: &ast::Expr) { }
+    fn check_expr_post(&mut self, _: &EarlyContext<'_>, _: &ast::Expr) { }
+    fn check_ty(&mut self, _: &EarlyContext<'_>, _: &ast::Ty) { }
+    fn check_generic_param(&mut self, _: &EarlyContext<'_>, _: &ast::GenericParam) { }
+    fn check_generics(&mut self, _: &EarlyContext<'_>, _: &ast::Generics) { }
+    fn check_where_predicate(&mut self, _: &EarlyContext<'_>, _: &ast::WherePredicate) { }
+    fn check_poly_trait_ref(&mut self, _: &EarlyContext<'_>, _: &ast::PolyTraitRef,
                             _: &ast::TraitBoundModifier) { }
-    fn check_fn(&mut self, _: &EarlyContext,
-        _: ast_visit::FnKind, _: &ast::FnDecl, _: Span, _: ast::NodeId) { }
-    fn check_fn_post(&mut self, _: &EarlyContext,
-        _: ast_visit::FnKind, _: &ast::FnDecl, _: Span, _: ast::NodeId) { }
-    fn check_trait_item(&mut self, _: &EarlyContext, _: &ast::TraitItem) { }
-    fn check_trait_item_post(&mut self, _: &EarlyContext, _: &ast::TraitItem) { }
-    fn check_impl_item(&mut self, _: &EarlyContext, _: &ast::ImplItem) { }
-    fn check_impl_item_post(&mut self, _: &EarlyContext, _: &ast::ImplItem) { }
-    fn check_struct_def(&mut self, _: &EarlyContext,
+    fn check_fn(&mut self, _: &EarlyContext<'_>,
+        _: ast_visit::FnKind<'_>, _: &ast::FnDecl, _: Span, _: ast::NodeId) { }
+    fn check_fn_post(&mut self, _: &EarlyContext<'_>,
+        _: ast_visit::FnKind<'_>, _: &ast::FnDecl, _: Span, _: ast::NodeId) { }
+    fn check_trait_item(&mut self, _: &EarlyContext<'_>, _: &ast::TraitItem) { }
+    fn check_trait_item_post(&mut self, _: &EarlyContext<'_>, _: &ast::TraitItem) { }
+    fn check_impl_item(&mut self, _: &EarlyContext<'_>, _: &ast::ImplItem) { }
+    fn check_impl_item_post(&mut self, _: &EarlyContext<'_>, _: &ast::ImplItem) { }
+    fn check_struct_def(&mut self, _: &EarlyContext<'_>,
         _: &ast::VariantData, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { }
-    fn check_struct_def_post(&mut self, _: &EarlyContext,
+    fn check_struct_def_post(&mut self, _: &EarlyContext<'_>,
         _: &ast::VariantData, _: ast::Ident, _: &ast::Generics, _: ast::NodeId) { }
-    fn check_struct_field(&mut self, _: &EarlyContext, _: &ast::StructField) { }
-    fn check_variant(&mut self, _: &EarlyContext, _: &ast::Variant, _: &ast::Generics) { }
-    fn check_variant_post(&mut self, _: &EarlyContext, _: &ast::Variant, _: &ast::Generics) { }
-    fn check_lifetime(&mut self, _: &EarlyContext, _: &ast::Lifetime) { }
-    fn check_path(&mut self, _: &EarlyContext, _: &ast::Path, _: ast::NodeId) { }
-    fn check_attribute(&mut self, _: &EarlyContext, _: &ast::Attribute) { }
-    fn check_mac_def(&mut self, _: &EarlyContext, _: &ast::MacroDef, _id: ast::NodeId) { }
-    fn check_mac(&mut self, _: &EarlyContext, _: &ast::Mac) { }
+    fn check_struct_field(&mut self, _: &EarlyContext<'_>, _: &ast::StructField) { }
+    fn check_variant(&mut self, _: &EarlyContext<'_>, _: &ast::Variant, _: &ast::Generics) { }
+    fn check_variant_post(&mut self, _: &EarlyContext<'_>, _: &ast::Variant, _: &ast::Generics) { }
+    fn check_lifetime(&mut self, _: &EarlyContext<'_>, _: &ast::Lifetime) { }
+    fn check_path(&mut self, _: &EarlyContext<'_>, _: &ast::Path, _: ast::NodeId) { }
+    fn check_attribute(&mut self, _: &EarlyContext<'_>, _: &ast::Attribute) { }
+    fn check_mac_def(&mut self, _: &EarlyContext<'_>, _: &ast::MacroDef, _id: ast::NodeId) { }
+    fn check_mac(&mut self, _: &EarlyContext<'_>, _: &ast::Mac) { }
 
     /// Called when entering a syntax node that can have lint attributes such
     /// as `#[allow(...)]`. Called with *all* the attributes of that node.
-    fn enter_lint_attrs(&mut self, _: &EarlyContext, _: &[ast::Attribute]) { }
+    fn enter_lint_attrs(&mut self, _: &EarlyContext<'_>, _: &[ast::Attribute]) { }
 
     /// Counterpart to `enter_lint_attrs`.
-    fn exit_lint_attrs(&mut self, _: &EarlyContext, _: &[ast::Attribute]) { }
+    fn exit_lint_attrs(&mut self, _: &EarlyContext<'_>, _: &[ast::Attribute]) { }
 }
 
 /// A lint pass boxed up as a trait object.
@@ -728,7 +728,7 @@ fn visit_impl_item(&mut self, impl_item: &'tcx hir::ImplItem) {
     }
 }
 
-pub fn provide(providers: &mut Providers) {
+pub fn provide(providers: &mut Providers<'_>) {
     providers.lint_levels = lint_levels;
 }
 
index f4b44043389615d2c2540f4b692bf198ae3bd2c3..4720bb2954963a1169ad66f9606b93e03e57d379 100644 (file)
@@ -244,7 +244,7 @@ fn encode_metadata<'a, 'tcx>(&self,
 // In order to get this left-to-right dependency ordering, we perform a
 // topological sort of all crates putting the leaves at the right-most
 // positions.
-pub fn used_crates(tcx: TyCtxt, prefer: LinkagePreference)
+pub fn used_crates(tcx: TyCtxt<'_, '_, '_>, prefer: LinkagePreference)
     -> Vec<(CrateNum, LibSource)>
 {
     let mut libs = tcx.crates()
index d320173f9f47d01d95361323f5e58db16819f902..66305ae8836ee90c1f63b23601179ac6def17a85 100644 (file)
@@ -285,7 +285,7 @@ fn visit_path(&mut self, path: &'tcx hir::Path, _: hir::HirId) {
     }
 }
 
-fn has_allow_dead_code_or_lang_attr(tcx: TyCtxt,
+fn has_allow_dead_code_or_lang_attr(tcx: TyCtxt<'_, '_, '_>,
                                     id: ast::NodeId,
                                     attrs: &[ast::Attribute]) -> bool {
     if attr::contains_name(attrs, "lang") {
index a9c118d606b2eb1584a7d8dd9a546cb74e16c935..14551261819a6cd4309a87df5db14e3ed6d8cad9 100644 (file)
@@ -256,7 +256,7 @@ fn calculate_type<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     return ret;
 }
 
-fn add_library(tcx: TyCtxt,
+fn add_library(tcx: TyCtxt<'_, '_, '_>,
                cnum: CrateNum,
                link: LinkagePreference,
                m: &mut FxHashMap<CrateNum, LinkagePreference>) {
index b0acc6f20e691f56a0c13070ef9203d9fa87776a..b06d881bcaea41a54de2d5cdb04cb79918afe2c4 100644 (file)
@@ -57,7 +57,7 @@ fn visit_impl_item(&mut self, _impl_item: &'tcx ImplItem) {
 }
 
 pub fn find_entry_point(session: &Session,
-                        hir_map: &hir_map::Map,
+                        hir_map: &hir_map::Map<'_>,
                         crate_name: &str) {
     let any_exe = session.crate_types.borrow().iter().any(|ty| {
         *ty == config::CrateType::Executable
@@ -113,7 +113,7 @@ fn entry_point_type(item: &Item, at_root: bool) -> EntryPointType {
 }
 
 
-fn find_item(item: &Item, ctxt: &mut EntryContext, at_root: bool) {
+fn find_item(item: &Item, ctxt: &mut EntryContext<'_, '_>, at_root: bool) {
     match entry_point_type(item, at_root) {
         EntryPointType::MainNamed => {
             if ctxt.main_fn.is_none() {
@@ -154,7 +154,7 @@ fn find_item(item: &Item, ctxt: &mut EntryContext, at_root: bool) {
     }
 }
 
-fn configure_main(this: &mut EntryContext, crate_name: &str) {
+fn configure_main(this: &mut EntryContext<'_, '_>, crate_name: &str) {
     if let Some((node_id, span)) = this.start_fn {
         this.session.entry_fn.set(Some((node_id, span, EntryFnType::Start)));
     } else if let Some((node_id, span)) = this.attr_main_fn {
index 01783eb0ff65f8b90cf561c59d790c5994822d64..6a254f1a189b54c812618b939bbbf952468e068e 100644 (file)
@@ -106,7 +106,7 @@ pub fn compare_stable(&self,
     }
 }
 
-pub fn metadata_symbol_name(tcx: ty::TyCtxt) -> String {
+pub fn metadata_symbol_name(tcx: ty::TyCtxt<'_, '_, '_>) -> String {
     format!("rust_metadata_{}_{}",
             tcx.original_crate_name(LOCAL_CRATE),
             tcx.crate_disambiguator(LOCAL_CRATE).to_fingerprint().to_hex())
index 469ae04c0fdc10bb70dc74c349f461d33ffb37f7..1a86dc4027e877d63038e0b0794156335439145c 100644 (file)
@@ -211,7 +211,7 @@ enum OverloadedCallType {
 }
 
 impl OverloadedCallType {
-    fn from_trait_id(tcx: TyCtxt, trait_id: DefId) -> OverloadedCallType {
+    fn from_trait_id(tcx: TyCtxt<'_, '_, '_>, trait_id: DefId) -> OverloadedCallType {
         for &(maybe_function_trait, overloaded_call_type) in &[
             (tcx.lang_items().fn_once_trait(), FnOnceOverloadedCall),
             (tcx.lang_items().fn_mut_trait(), FnMutOverloadedCall),
@@ -228,7 +228,7 @@ fn from_trait_id(tcx: TyCtxt, trait_id: DefId) -> OverloadedCallType {
         bug!("overloaded call didn't map to known function trait")
     }
 
-    fn from_method_id(tcx: TyCtxt, method_id: DefId) -> OverloadedCallType {
+    fn from_method_id(tcx: TyCtxt<'_, '_, '_>, method_id: DefId) -> OverloadedCallType {
         let method = tcx.associated_item(method_id);
         OverloadedCallType::from_trait_id(tcx, method.container.id())
     }
index 0d70a64123bf364903fa7e328d4133d3872881aa..ff4b1fc2921b25bb8ce377c36382756362bc4409 100644 (file)
@@ -158,7 +158,7 @@ enum LiveNodeKind {
     ExitNode
 }
 
-fn live_node_kind_to_string(lnk: LiveNodeKind, tcx: TyCtxt) -> String {
+fn live_node_kind_to_string(lnk: LiveNodeKind, tcx: TyCtxt<'_, '_, '_>) -> String {
     let cm = tcx.sess.source_map();
     match lnk {
         FreeVarNode(s) => {
@@ -195,13 +195,13 @@ pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
 }
 
 impl fmt::Debug for LiveNode {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "ln({})", self.get())
     }
 }
 
 impl fmt::Debug for Variable {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "v({})", self.get())
     }
 }
@@ -371,7 +371,7 @@ fn visit_fn<'a, 'tcx: 'a>(ir: &mut IrMaps<'a, 'tcx>,
         }
     }
 
-    debug!("creating fn_maps: {:?}", &fn_maps as *const IrMaps);
+    debug!("creating fn_maps: {:?}", &fn_maps as *const IrMaps<'_, '_>);
 
     let body = ir.tcx.hir.body(body_id);
 
@@ -1388,7 +1388,7 @@ fn access_path(&mut self, hir_id: HirId, path: &hir::Path, succ: LiveNode, acc:
 
     fn propagate_through_loop(&mut self,
                               expr: &Expr,
-                              kind: LoopKind,
+                              kind: LoopKind<'_>,
                               body: &hir::Block,
                               succ: LiveNode)
                               -> LiveNode {
index 172511474710d6e47c6cf27b4eb6751c04fed669..13c969cec297e9e37d83cfe2b4486c22089026fc 100644 (file)
@@ -324,7 +324,7 @@ pub fn from_borrow_kind(borrow_kind: ty::BorrowKind) -> MutabilityCategory {
     }
 
     fn from_pointer_kind(base_mutbl: MutabilityCategory,
-                         ptr: PointerKind) -> MutabilityCategory {
+                         ptr: PointerKind<'_>) -> MutabilityCategory {
         let ret = match ptr {
             Unique => {
                 base_mutbl.inherit()
@@ -341,7 +341,8 @@ fn from_pointer_kind(base_mutbl: MutabilityCategory,
         ret
     }
 
-    fn from_local(tcx: TyCtxt, tables: &ty::TypeckTables, id: ast::NodeId) -> MutabilityCategory {
+    fn from_local(tcx: TyCtxt<'_, '_, '_>, tables: &ty::TypeckTables<'_>,
+                  id: ast::NodeId) -> MutabilityCategory {
         let ret = match tcx.hir.get(id) {
             Node::Binding(p) => match p.node {
                 PatKind::Binding(..) => {
@@ -1488,7 +1489,7 @@ pub fn upvar_cat(&self) -> Option<&Categorization<'tcx>> {
         }
     }
 
-    pub fn descriptive_string(&self, tcx: TyCtxt) -> String {
+    pub fn descriptive_string(&self, tcx: TyCtxt<'_, '_, '_>) -> String {
         match self.cat {
             Categorization::StaticItem => {
                 "static item".to_string()
@@ -1546,7 +1547,7 @@ pub fn descriptive_string(&self, tcx: TyCtxt) -> String {
     }
 }
 
-pub fn ptr_sigil(ptr: PointerKind) -> &'static str {
+pub fn ptr_sigil(ptr: PointerKind<'_>) -> &'static str {
     match ptr {
         Unique => "Box",
         BorrowedPtr(ty::ImmBorrow, _) => "&",
@@ -1557,7 +1558,7 @@ pub fn ptr_sigil(ptr: PointerKind) -> &'static str {
 }
 
 impl fmt::Debug for InteriorKind {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             InteriorField(FieldIndex(_, info)) => write!(f, "{}", info),
             InteriorElement(..) => write!(f, "[]"),
@@ -1566,13 +1567,13 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for Upvar {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{:?}/{:?}", self.id, self.kind)
     }
 }
 
 impl fmt::Display for Upvar {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         let kind = match self.kind {
             ty::ClosureKind::Fn => "Fn",
             ty::ClosureKind::FnMut => "FnMut",
index 70fed9af92128367700c4fc9b8a8aebf84436cd7..880d428e7a580c7360fdbd8d1693393e3284b4a8 100644 (file)
@@ -59,7 +59,7 @@ fn default() -> Self {
 }
 
 impl<Id: Hash + Eq + fmt::Debug> fmt::Debug for AccessLevels<Id> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt::Debug::fmt(&self.map, f)
     }
 }
index 55ee8987e8ad54ccbe49313878ef403d7888e3b8..9416d60c9d1a3bfeb05a4c56737f5d3b5ed39e26 100644 (file)
@@ -443,7 +443,7 @@ fn reachable_set<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, crate_num: CrateNum) ->
     ReachableSet(Lrc::new(reachable_context.reachable_symbols))
 }
 
-pub fn provide(providers: &mut Providers) {
+pub fn provide(providers: &mut Providers<'_>) {
     *providers = Providers {
         reachable_set,
         ..*providers
index 191fa0bc7c56609d9f49bd056680cd6836ceebb9..01b0d2c27a1418b8b78988a670869341715633b2 100644 (file)
@@ -107,7 +107,7 @@ pub struct Scope {
 }
 
 impl fmt::Debug for Scope {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self.data {
             ScopeData::Node => write!(fmt, "Node({:?})", self.id),
             ScopeData::CallSite => write!(fmt, "CallSite({:?})", self.id),
@@ -179,7 +179,7 @@ pub fn item_local_id(&self) -> hir::ItemLocalId {
         self.id
     }
 
-    pub fn node_id(&self, tcx: TyCtxt, scope_tree: &ScopeTree) -> ast::NodeId {
+    pub fn node_id(&self, tcx: TyCtxt<'_, '_, '_>, scope_tree: &ScopeTree) -> ast::NodeId {
         match scope_tree.root_body {
             Some(hir_id) => {
                 tcx.hir.hir_to_node_id(hir::HirId {
@@ -194,7 +194,7 @@ pub fn node_id(&self, tcx: TyCtxt, scope_tree: &ScopeTree) -> ast::NodeId {
     /// Returns the span of this Scope.  Note that in general the
     /// returned span may not correspond to the span of any node id in
     /// the AST.
-    pub fn span(&self, tcx: TyCtxt, scope_tree: &ScopeTree) -> Span {
+    pub fn span(&self, tcx: TyCtxt<'_, '_, '_>, scope_tree: &ScopeTree) -> Span {
         let node_id = self.node_id(tcx, scope_tree);
         if node_id == ast::DUMMY_NODE_ID {
             return DUMMY_SP;
@@ -748,7 +748,7 @@ pub fn body_expr_count(&self, body_id: hir::BodyId) -> Option<usize> {
 }
 
 /// Records the lifetime of a local variable as `cx.var_parent`
-fn record_var_lifetime(visitor: &mut RegionResolutionVisitor,
+fn record_var_lifetime(visitor: &mut RegionResolutionVisitor<'_, '_>,
                        var_id: hir::ItemLocalId,
                        _sp: Span) {
     match visitor.cx.var_parent {
@@ -1383,7 +1383,7 @@ fn region_scope_tree<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId)
     Lrc::new(scope_tree)
 }
 
-pub fn provide(providers: &mut Providers) {
+pub fn provide(providers: &mut Providers<'_>) {
     *providers = Providers {
         region_scope_tree,
         ..*providers
index db931d0a739ff8e7eedeb75d2b333899a913ca87..cda7d8d6b900330391256e1e1e7730bee6868ebb 100644 (file)
@@ -88,7 +88,7 @@ pub enum Region {
 }
 
 impl Region {
-    fn early(hir_map: &Map, index: &mut u32, param: &GenericParam) -> (ParamName, Region) {
+    fn early(hir_map: &Map<'_>, index: &mut u32, param: &GenericParam) -> (ParamName, Region) {
         let i = *index;
         *index += 1;
         let def_id = hir_map.local_def_id(param.id);
@@ -97,7 +97,7 @@ fn early(hir_map: &Map, index: &mut u32, param: &GenericParam) -> (ParamName, Re
         (param.name.modern(), Region::EarlyBound(i, def_id, origin))
     }
 
-    fn late(hir_map: &Map, param: &GenericParam) -> (ParamName, Region) {
+    fn late(hir_map: &Map<'_>, param: &GenericParam) -> (ParamName, Region) {
         let depth = ty::INNERMOST;
         let def_id = hir_map.local_def_id(param.id);
         let origin = LifetimeDefOrigin::from_param(param);
@@ -348,7 +348,7 @@ struct ElisionFailureInfo {
 
 const ROOT_SCOPE: ScopeRef<'static> = &Scope::Root;
 
-pub fn provide(providers: &mut ty::query::Providers) {
+pub fn provide(providers: &mut ty::query::Providers<'_>) {
     *providers = ty::query::Providers {
         resolve_lifetimes,
 
@@ -1371,9 +1371,9 @@ fn hack<F>(&mut self, f: F)
         f(self)
     }
 
-    fn with<F>(&mut self, wrap_scope: Scope, f: F)
+    fn with<F>(&mut self, wrap_scope: Scope<'_>, f: F)
     where
-        F: for<'b> FnOnce(ScopeRef, &mut LifetimeContext<'b, 'tcx>),
+        F: for<'b> FnOnce(ScopeRef<'_>, &mut LifetimeContext<'b, 'tcx>),
     {
         let LifetimeContext {
             tcx,
@@ -2159,7 +2159,7 @@ fn resolve_elided_lifetimes(&mut self,
 
     fn report_elision_failure(
         &mut self,
-        db: &mut DiagnosticBuilder,
+        db: &mut DiagnosticBuilder<'_>,
         params: &[ElisionFailureInfo],
     ) {
         let mut m = String::new();
@@ -2268,7 +2268,8 @@ fn resolve_object_lifetime_default(&mut self, lifetime_ref: &'tcx hir::Lifetime)
         self.insert_lifetime(lifetime_ref, lifetime.shifted(late_depth));
     }
 
-    fn check_lifetime_params(&mut self, old_scope: ScopeRef, params: &'tcx [hir::GenericParam]) {
+    fn check_lifetime_params(&mut self, old_scope: ScopeRef<'_>,
+                             params: &'tcx [hir::GenericParam]) {
         let lifetimes: Vec<_> = params.iter().filter_map(|param| match param.kind {
             GenericParamKind::Lifetime { .. } => Some((param, param.name)),
             _ => None,
@@ -2351,7 +2352,7 @@ fn check_lifetime_params(&mut self, old_scope: ScopeRef, params: &'tcx [hir::Gen
 
     fn check_lifetime_param_for_shadowing(
         &self,
-        mut old_scope: ScopeRef,
+        mut old_scope: ScopeRef<'_>,
         param: &'tcx hir::GenericParam,
     ) {
         for label in &self.labels_in_fn {
index cbf6722c0fd375dbcbfbac29a7dd1862098ef168..941bd4dda99d725d32b9ff2ceb1a57709ba11720 100644 (file)
@@ -70,7 +70,7 @@ pub fn link_name(attrs: &[ast::Attribute]) -> Option<Symbol> {
 /// Not all lang items are always required for each compilation, particularly in
 /// the case of panic=abort. In these situations some lang items are injected by
 /// crates and don't actually need to be defined in libstd.
-pub fn whitelisted(tcx: TyCtxt, lang_item: lang_items::LangItem) -> bool {
+pub fn whitelisted(tcx: TyCtxt<'_, '_, '_>, lang_item: lang_items::LangItem) -> bool {
     // If we're not compiling with unwinding, we won't actually need these
     // symbols. Other panic runtimes ensure that the relevant symbols are
     // available to link things together, but they're never exercised.
index d1f050fcd424d23201142bd3453440a245c4b931..32c60c143065d7f4c6b6419eb91b49188c180b07 100644 (file)
@@ -57,8 +57,8 @@ pub fn invalidate(&self) {
 
     pub fn predecessors(
         &self,
-        mir: &Mir
-    ) -> MappedReadGuard<IndexVec<BasicBlock, Vec<BasicBlock>>> {
+        mir: &Mir<'_>
+    ) -> MappedReadGuard<'_, IndexVec<BasicBlock, Vec<BasicBlock>>> {
         if self.predecessors.borrow().is_none() {
             *self.predecessors.borrow_mut() = Some(calculate_predecessors(mir));
         }
@@ -67,7 +67,7 @@ pub fn predecessors(
     }
 }
 
-fn calculate_predecessors(mir: &Mir) -> IndexVec<BasicBlock, Vec<BasicBlock>> {
+fn calculate_predecessors(mir: &Mir<'_>) -> IndexVec<BasicBlock, Vec<BasicBlock>> {
     let mut result = IndexVec::from_elem(vec![], mir.basic_blocks());
     for (bb, data) in mir.basic_blocks().iter_enumerated() {
         if let Some(ref term) = data.terminator {
index cccde692bf7895ad13173ef323fa851723176e3a..566673857b975b14df86284a76cf19ecd5e12f18 100644 (file)
@@ -429,13 +429,13 @@ pub fn description(&self) -> &str {
 }
 
 impl<'tcx> fmt::Display for EvalError<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{:?}", self.kind)
     }
 }
 
 impl<'tcx, O: fmt::Debug> fmt::Debug for EvalErrorKind<'tcx, O> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         use self::EvalErrorKind::*;
         match *self {
             PointerOutOfBounds { ptr, access, allocation_size } => {
index 5fa47ef42ec3507287cfc4a3ff85ed593d2fac75..be0639f242094b0e296b4bb5e67b13028e58715c 100644 (file)
@@ -253,7 +253,7 @@ pub struct AllocDecodingState {
 
 impl AllocDecodingState {
 
-    pub fn new_decoding_session(&self) -> AllocDecodingSession {
+    pub fn new_decoding_session(&self) -> AllocDecodingSession<'_> {
         static DECODER_SESSION_ID: AtomicU32 = AtomicU32::new(0);
         let counter = DECODER_SESSION_ID.fetch_add(1, Ordering::SeqCst);
 
@@ -394,7 +394,7 @@ pub fn decode_alloc_id<'a, 'tcx, D>(&self,
 }
 
 impl fmt::Display for AllocId {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{}", self.0)
     }
 }
index 8fea749e5ab4973dc6b044df2d9bbff35ac257a9..3e6246f2ea8d80e5f45defb710e5ff3c6459e286 100644 (file)
@@ -845,7 +845,7 @@ fn new_local(
     ///
     /// This must be inserted into the `local_decls` list as the first local.
     #[inline]
-    pub fn new_return_place(return_ty: Ty, span: Span) -> LocalDecl {
+    pub fn new_return_place(return_ty: Ty<'_>, span: Span) -> LocalDecl<'_> {
         LocalDecl {
             mutability: Mutability::Mut,
             ty: return_ty,
@@ -1082,11 +1082,11 @@ pub enum TerminatorKind<'tcx> {
     iter::Chain<option::IntoIter<&'a mut BasicBlock>, slice::IterMut<'a, BasicBlock>>;
 
 impl<'tcx> Terminator<'tcx> {
-    pub fn successors(&self) -> Successors {
+    pub fn successors(&self) -> Successors<'_> {
         self.kind.successors()
     }
 
-    pub fn successors_mut(&mut self) -> SuccessorsMut {
+    pub fn successors_mut(&mut self) -> SuccessorsMut<'_> {
         self.kind.successors_mut()
     }
 
@@ -1115,7 +1115,7 @@ pub fn if_<'a, 'gcx>(
         }
     }
 
-    pub fn successors(&self) -> Successors {
+    pub fn successors(&self) -> Successors<'_> {
         use self::TerminatorKind::*;
         match *self {
             Resume
@@ -1200,7 +1200,7 @@ pub fn successors(&self) -> Successors {
         }
     }
 
-    pub fn successors_mut(&mut self) -> SuccessorsMut {
+    pub fn successors_mut(&mut self) -> SuccessorsMut<'_> {
         use self::TerminatorKind::*;
         match *self {
             Resume
@@ -1363,7 +1363,7 @@ pub fn terminator_mut(&mut self) -> &mut Terminator<'tcx> {
 
     pub fn retain_statements<F>(&mut self, mut f: F)
     where
-        F: FnMut(&mut Statement) -> bool,
+        F: FnMut(&mut Statement<'_>) -> bool,
     {
         for s in &mut self.statements {
             if !f(s) {
@@ -1437,7 +1437,7 @@ pub fn visitable(&self, index: usize) -> &dyn MirVisitable<'tcx> {
 }
 
 impl<'tcx> Debug for TerminatorKind<'tcx> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         self.fmt_head(fmt)?;
         let successor_count = self.successors().count();
         let labels = self.fmt_successor_labels();
@@ -1731,7 +1731,7 @@ pub enum ValidationOp {
 }
 
 impl Debug for ValidationOp {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::ValidationOp::*;
         match *self {
             Acquire => write!(fmt, "Acquire"),
@@ -1752,7 +1752,7 @@ pub struct ValidationOperand<'tcx, T> {
 }
 
 impl<'tcx, T: Debug> Debug for ValidationOperand<'tcx, T> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         write!(fmt, "{:?}: {:?}", self.place, self.ty)?;
         if let Some(ce) = self.re {
             // (reuse lifetime rendering policy from ppaux.)
@@ -1766,7 +1766,7 @@ fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
 }
 
 impl<'tcx> Debug for Statement<'tcx> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::StatementKind::*;
         match self.kind {
             Assign(ref place, ref rv) => write!(fmt, "{:?} = {:?}", place, rv),
@@ -1923,7 +1923,7 @@ pub fn local(&self) -> Option<Local> {
 }
 
 impl<'tcx> Debug for Place<'tcx> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::Place::*;
 
         match *self {
@@ -2018,7 +2018,7 @@ pub enum Operand<'tcx> {
 }
 
 impl<'tcx> Debug for Operand<'tcx> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::Operand::*;
         match *self {
             Constant(ref a) => write!(fmt, "{:?}", a),
@@ -2203,7 +2203,7 @@ pub enum UnOp {
 }
 
 impl<'tcx> Debug for Rvalue<'tcx> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         use self::Rvalue::*;
 
         match *self {
@@ -2242,7 +2242,7 @@ fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
             }
 
             Aggregate(ref kind, ref places) => {
-                fn fmt_tuple(fmt: &mut Formatter, places: &[Operand]) -> fmt::Result {
+                fn fmt_tuple(fmt: &mut Formatter<'_>, places: &[Operand<'_>]) -> fmt::Result {
                     let mut tuple_fmt = fmt.debug_tuple("");
                     for place in places {
                         tuple_fmt.field(place);
@@ -2356,14 +2356,14 @@ pub struct Promoted {
 }
 
 impl<'tcx> Debug for Constant<'tcx> {
-    fn fmt(&self, fmt: &mut Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut Formatter<'_>) -> fmt::Result {
         write!(fmt, "const ")?;
         fmt_const_val(fmt, self.literal)
     }
 }
 
 /// Write a `ConstValue` in a way closer to the original source code than the `Debug` output.
-pub fn fmt_const_val(f: &mut impl Write, const_val: &ty::Const) -> fmt::Result {
+pub fn fmt_const_val(f: &mut impl Write, const_val: &ty::Const<'_>) -> fmt::Result {
     use ty::TyKind::*;
     let value = const_val.val;
     let ty = const_val.ty;
@@ -2478,7 +2478,7 @@ pub struct Location {
 }
 
 impl fmt::Debug for Location {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(fmt, "{:?}[{}]", self.block, self.statement_index)
     }
 }
index eb779e6382f4bebb5e7418f7645329cea222cc66..12bc9cf76b5a9a88e2ab7cce7edffeaa7b1d6466 100644 (file)
@@ -2379,7 +2379,7 @@ pub fn check_nightly_options(matches: &getopts::Matches, flags: &[RustcOptGroup]
 }
 
 impl fmt::Display for CrateType {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             CrateType::Executable => "bin".fmt(f),
             CrateType::Dylib => "dylib".fmt(f),
index be347253e7f06879517f18b3fa6c5ba90fa0684c..0bef898ecc7750fd2405a3e81f8b5c5a814f5999 100644 (file)
@@ -705,7 +705,7 @@ pub fn sysroot<'a>(&'a self) -> &'a Path {
                 .expect("missing sysroot and default_sysroot in Session"),
         }
     }
-    pub fn target_filesearch(&self, kind: PathKind) -> filesearch::FileSearch {
+    pub fn target_filesearch(&self, kind: PathKind) -> filesearch::FileSearch<'_> {
         filesearch::FileSearch::new(
             self.sysroot(),
             self.opts.target_triple.triple(),
@@ -713,7 +713,7 @@ pub fn target_filesearch(&self, kind: PathKind) -> filesearch::FileSearch {
             kind,
         )
     }
-    pub fn host_filesearch(&self, kind: PathKind) -> filesearch::FileSearch {
+    pub fn host_filesearch(&self, kind: PathKind) -> filesearch::FileSearch<'_> {
         filesearch::FileSearch::new(
             self.sysroot(),
             config::host_triple(),
@@ -803,7 +803,7 @@ pub fn mark_incr_comp_session_as_invalid(&self) {
         *incr_comp_session = IncrCompSession::InvalidBecauseOfErrors { session_directory };
     }
 
-    pub fn incr_comp_session_dir(&self) -> cell::Ref<PathBuf> {
+    pub fn incr_comp_session_dir(&self) -> cell::Ref<'_, PathBuf> {
         let incr_comp_session = self.incr_comp_session.borrow();
         cell::Ref::map(
             incr_comp_session,
@@ -826,7 +826,7 @@ pub fn incr_comp_session_dir(&self) -> cell::Ref<PathBuf> {
         )
     }
 
-    pub fn incr_comp_session_dir_opt(&self) -> Option<cell::Ref<PathBuf>> {
+    pub fn incr_comp_session_dir_opt(&self) -> Option<cell::Ref<'_, PathBuf>> {
         if self.opts.incremental.is_some() {
             Some(self.incr_comp_session_dir())
         } else {
@@ -1253,7 +1253,7 @@ pub fn to_fingerprint(self) -> Fingerprint {
 }
 
 impl fmt::Display for CrateDisambiguator {
-    fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> Result<(), fmt::Error> {
         let (a, b) = self.0.as_value();
         let as_u128 = a as u128 | ((b as u128) << 64);
         f.write_str(&base_n::encode(as_u128, base_n::CASE_INSENSITIVE))
index d2dca9f60845a42ee91d7c2d1e47b344633a786a..be1bfcc0894dd11c5899ec72c35172f65f4cecf8 100644 (file)
@@ -57,7 +57,7 @@ pub fn add_path(&mut self, path: &str, output: config::ErrorOutputType) {
         self.paths.push((kind, PathBuf::from(path)));
     }
 
-    pub fn iter(&self, kind: PathKind) -> Iter {
+    pub fn iter(&self, kind: PathKind) -> Iter<'_> {
         Iter { kind: kind, iter: self.paths.iter() }
     }
 }
index 8f106a08125386a56ee32998d2b3cbe0eeb554eb..ec1c5a40b4fa354015dc43ebd3fa15d475e4b3b1 100644 (file)
@@ -483,14 +483,15 @@ fn add_user_pred<'c>(
         }
     }
 
-    pub fn region_name(&self, region: Region) -> Option<String> {
+    pub fn region_name(&self, region: Region<'_>) -> Option<String> {
         match region {
             &ty::ReEarlyBound(r) => Some(r.name.to_string()),
             _ => None,
         }
     }
 
-    pub fn get_lifetime(&self, region: Region, names_map: &FxHashMap<String, String>) -> String {
+    pub fn get_lifetime(&self, region: Region<'_>,
+                        names_map: &FxHashMap<String, String>) -> String {
         self.region_name(region)
             .map(|name|
                 names_map.get(&name).unwrap_or_else(||
@@ -591,7 +592,7 @@ pub fn map_vid_to_region<'cx>(
         finished_map
     }
 
-    pub fn is_of_param(&self, substs: &Substs) -> bool {
+    pub fn is_of_param(&self, substs: &Substs<'_>) -> bool {
         if substs.is_noop() {
             return false;
         }
@@ -611,7 +612,7 @@ pub fn evaluate_nested_obligations<
         T: Iterator<Item = Obligation<'cx, ty::Predicate<'cx>>>,
     >(
         &self,
-        ty: ty::Ty,
+        ty: ty::Ty<'_>,
         nested: T,
         computed_preds: &'b mut FxHashSet<ty::Predicate<'cx>>,
         fresh_preds: &'b mut FxHashSet<ty::Predicate<'cx>>,
index 9e9cdc69441cd16d4617b6d9ab0bd0240860f0dc..7401d4099ff6dff05b6305276a9c6ce753ee5ed1 100644 (file)
@@ -337,7 +337,7 @@ pub fn orphan_check<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
 ///
 /// Note that this function is never called for types that have both type
 /// parameters and inference variables.
-fn orphan_check_trait_ref<'tcx>(tcx: TyCtxt,
+fn orphan_check_trait_ref<'tcx>(tcx: TyCtxt<'_, '_, '_>,
                                 trait_ref: ty::TraitRef<'tcx>,
                                 in_crate: InCrate)
                                 -> Result<(), OrphanCheckErr<'tcx>>
@@ -389,7 +389,7 @@ fn orphan_check_trait_ref<'tcx>(tcx: TyCtxt,
     return Err(OrphanCheckErr::NoLocalInputType);
 }
 
-fn uncovered_tys<'tcx>(tcx: TyCtxt, ty: Ty<'tcx>, in_crate: InCrate)
+fn uncovered_tys<'tcx>(tcx: TyCtxt<'_, '_, '_>, ty: Ty<'tcx>, in_crate: InCrate)
                        -> Vec<Ty<'tcx>> {
     if ty_is_local_constructor(ty, in_crate) {
         vec![]
@@ -402,19 +402,19 @@ fn uncovered_tys<'tcx>(tcx: TyCtxt, ty: Ty<'tcx>, in_crate: InCrate)
     }
 }
 
-fn is_possibly_remote_type(ty: Ty, _in_crate: InCrate) -> bool {
+fn is_possibly_remote_type(ty: Ty<'_>, _in_crate: InCrate) -> bool {
     match ty.sty {
         ty::Projection(..) | ty::Param(..) => true,
         _ => false,
     }
 }
 
-fn ty_is_local(tcx: TyCtxt, ty: Ty, in_crate: InCrate) -> bool {
+fn ty_is_local(tcx: TyCtxt<'_, '_, '_>, ty: Ty<'_>, in_crate: InCrate) -> bool {
     ty_is_local_constructor(ty, in_crate) ||
         fundamental_ty(tcx, ty) && ty.walk_shallow().any(|t| ty_is_local(tcx, t, in_crate))
 }
 
-fn fundamental_ty(tcx: TyCtxt, ty: Ty) -> bool {
+fn fundamental_ty(tcx: TyCtxt<'_, '_, '_>, ty: Ty<'_>) -> bool {
     match ty.sty {
         ty::Ref(..) => true,
         ty::Adt(def, _) => def.is_fundamental(),
@@ -434,7 +434,7 @@ fn def_id_is_local(def_id: DefId, in_crate: InCrate) -> bool {
     }
 }
 
-fn ty_is_local_constructor(ty: Ty, in_crate: InCrate) -> bool {
+fn ty_is_local_constructor(ty: Ty<'_>, in_crate: InCrate) -> bool {
     debug!("ty_is_local_constructor({:?})", ty);
 
     match ty.sty {
index 6fb5acde72c49735d7280e8e9f39c8782c9a16f7..7695f26d701156272e31d9b59a710f6bab8124a4 100644 (file)
@@ -437,7 +437,7 @@ fn find_similar_impl_candidates(&self,
 
     fn report_similar_impl_candidates(&self,
                                       mut impl_candidates: Vec<ty::TraitRef<'tcx>>,
-                                      err: &mut DiagnosticBuilder)
+                                      err: &mut DiagnosticBuilder<'_>)
     {
         if impl_candidates.is_empty() {
             return;
@@ -930,7 +930,7 @@ fn suggest_remove_reference(&self,
     /// returns a span and `ArgKind` information that describes the
     /// arguments it expects. This can be supplied to
     /// `report_arg_count_mismatch`.
-    pub fn get_fn_like_arguments(&self, node: Node) -> (Span, Vec<ArgKind>) {
+    pub fn get_fn_like_arguments(&self, node: Node<'_>) -> (Span, Vec<ArgKind>) {
         match node {
             Node::Expr(&hir::Expr {
                 node: hir::ExprKind::Closure(_, ref _decl, id, span, _),
@@ -1378,7 +1378,7 @@ fn fold_ty(&mut self, ty: Ty<'tcx>) -> Ty<'tcx> {
     }
 
     fn note_obligation_cause<T>(&self,
-                                err: &mut DiagnosticBuilder,
+                                err: &mut DiagnosticBuilder<'_>,
                                 obligation: &Obligation<'tcx, T>)
         where T: fmt::Display
     {
@@ -1389,7 +1389,7 @@ fn note_obligation_cause<T>(&self,
     }
 
     fn note_obligation_cause_code<T>(&self,
-                                     err: &mut DiagnosticBuilder,
+                                     err: &mut DiagnosticBuilder<'_>,
                                      predicate: &T,
                                      cause_code: &ObligationCauseCode<'tcx>,
                                      obligated_types: &mut Vec<&ty::TyS<'tcx>>)
@@ -1545,7 +1545,7 @@ fn note_obligation_cause_code<T>(&self,
         }
     }
 
-    fn suggest_new_overflow_limit(&self, err: &mut DiagnosticBuilder) {
+    fn suggest_new_overflow_limit(&self, err: &mut DiagnosticBuilder<'_>) {
         let current_limit = self.tcx.sess.recursion_limit.get();
         let suggested_limit = current_limit * 2;
         err.help(&format!("consider adding a `#![recursion_limit=\"{}\"]` attribute to your crate",
index 6b1092814a4043616ab8d119d5078c6c7c70359b..bcbdb179464bece07c55cad98e998e5d676aa1bf 100644 (file)
@@ -1009,7 +1009,7 @@ fn self_ty(&self) -> ty::Binder<Ty<'tcx>> {
     }
 }
 
-pub fn provide(providers: &mut ty::query::Providers) {
+pub fn provide(providers: &mut ty::query::Providers<'_>) {
     *providers = ty::query::Providers {
         is_object_safe: object_safety::is_object_safe_provider,
         specialization_graph_of: specialize::specialization_graph_provider,
index f59812c0eea984f4212a3367aa585a35bf9df4c0..dcbddc03080916caf30a1e5d8f5cd2550b6997fd 100644 (file)
@@ -44,7 +44,7 @@ pub fn empty() -> Self {
     }
 }
 
-fn parse_error(tcx: TyCtxt, span: Span,
+fn parse_error(tcx: TyCtxt<'_, '_, '_>, span: Span,
                message: &str,
                label: &str,
                note: Option<&str>)
index 6a5ef75a660ba454027c9b9c8749039e6cd7d944..6708112697bb558d0963e3c3776f05eb8c6b6be6 100644 (file)
@@ -62,7 +62,7 @@ impl<F, G> fmt::Debug for CustomTypeOp<F, G>
 where
     G: Fn() -> String,
 {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "{}", (self.description)())
     }
 }
index ab71d13ab0686d1818257c8170ed3c3d456eb439..7300588f6af39f3e7f192a096a8c75a884fb1a60 100644 (file)
@@ -110,7 +110,7 @@ impl IntercrateAmbiguityCause {
     /// Emits notes when the overlap is caused by complex intercrate ambiguities.
     /// See #23980 for details.
     pub fn add_intercrate_ambiguity_hint<'a, 'tcx>(&self,
-                                                   err: &mut ::errors::DiagnosticBuilder) {
+                                                   err: &mut ::errors::DiagnosticBuilder<'_>) {
         err.note(&self.intercrate_ambiguity_hint());
     }
 
@@ -537,7 +537,7 @@ fn probe<R, F>(&mut self, f: F) -> R
     /// Wraps a commit_if_ok s.t. obligations collected during it are not returned in selection if
     /// the transaction fails and s.t. old obligations are retained.
     fn commit_if_ok<T, E, F>(&mut self, f: F) -> Result<T, E> where
-        F: FnOnce(&mut Self, &infer::CombinedSnapshot) -> Result<T, E>
+        F: FnOnce(&mut Self, &infer::CombinedSnapshot<'cx, 'tcx>) -> Result<T, E>
     {
         self.infcx.commit_if_ok(|snapshot| f(self, snapshot))
     }
@@ -1221,7 +1221,7 @@ fn candidate_from_obligation_no_cache<'o>(&mut self,
 
         // Winnow, but record the exact outcome of evaluation, which
         // is needed for specialization. Propagate overflow if it occurs.
-        let candidates: Result<Vec<Option<EvaluatedCandidate>>, _> = candidates
+        let candidates: Result<Vec<Option<EvaluatedCandidate<'_>>>, _> = candidates
             .into_iter()
             .map(|c| match self.evaluate_candidate(stack, &c) {
                 Ok(eval) if eval.may_apply() => Ok(Some(EvaluatedCandidate {
@@ -1233,7 +1233,7 @@ fn candidate_from_obligation_no_cache<'o>(&mut self,
             })
             .collect();
 
-        let mut candidates: Vec<EvaluatedCandidate> =
+        let mut candidates: Vec<EvaluatedCandidate<'_>> =
             candidates?.into_iter().filter_map(|c| c).collect();
 
         debug!("winnowed to {} candidates for {:?}: {:?}",
@@ -3245,8 +3245,8 @@ fn match_impl(&mut self,
     }
 
     fn fast_reject_trait_refs(&mut self,
-                              obligation: &TraitObligation,
-                              impl_trait_ref: &ty::TraitRef)
+                              obligation: &TraitObligation<'_>,
+                              impl_trait_ref: &ty::TraitRef<'_>)
                               -> bool
     {
         // We can avoid creating type variables and doing the full
@@ -3536,7 +3536,7 @@ fn next(&mut self) -> Option<&'o TraitObligationStack<'o,'tcx>> {
 }
 
 impl<'o,'tcx> fmt::Debug for TraitObligationStack<'o,'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "TraitObligationStack({:?})", self.obligation)
     }
 }
@@ -3552,7 +3552,7 @@ pub fn new(dep_node: DepNodeIndex, cached_value: T) -> Self {
         WithDepNode { dep_node, cached_value }
     }
 
-    pub fn get(&self, tcx: TyCtxt) -> T {
+    pub fn get(&self, tcx: TyCtxt<'_, '_, '_>) -> T {
         tcx.dep_graph.read_index(self.dep_node);
         self.cached_value.clone()
     }
index bd6c2982065ef1acfc05be875a0291dc5f94d903..84ffa22e5dd2ec7a3dec5ebd69b30a2361fcaf3c 100644 (file)
@@ -395,7 +395,7 @@ pub(super) fn specialization_graph_provider<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx
 
 /// Recovers the "impl X for Y" signature from `impl_def_id` and returns it as a
 /// string.
-fn to_pretty_impl_header(tcx: TyCtxt, impl_def_id: DefId) -> Option<String> {
+fn to_pretty_impl_header(tcx: TyCtxt<'_, '_, '_>, impl_def_id: DefId) -> Option<String> {
     use std::fmt::Write;
 
     let trait_ref = if let Some(tr) = tcx.impl_trait_ref(impl_def_id) {
index 756f55545bc45a87090a52085df7588197cbf1a8..e237cab5ea135abde38e63f0fb5d56c9a8e42c6d 100644 (file)
@@ -142,7 +142,7 @@ fn insert(&mut self,
                 possible_sibling,
             );
 
-            let overlap_error = |overlap: traits::coherence::OverlapResult| {
+            let overlap_error = |overlap: traits::coherence::OverlapResult<'_>| {
                 // overlap, but no specialization; error out
                 let trait_ref = overlap.impl_header.trait_ref.unwrap();
                 let self_ty = trait_ref.self_ty();
@@ -447,7 +447,7 @@ pub fn defs(
 
 /// Walk up the specialization ancestors of a given impl, starting with that
 /// impl itself.
-pub fn ancestors(tcx: TyCtxt,
+pub fn ancestors(tcx: TyCtxt<'_, '_, '_>,
                  trait_def_id: DefId,
                  start_from_impl: DefId)
                  -> Ancestors {
index 3244b1d7480ac95bac10e829c362ebcb798ae332..22e79fc2638abbf1a7f9e1a712c62060a91060ef 100644 (file)
 // structural impls for the structs in traits
 
 impl<'tcx, T: fmt::Debug> fmt::Debug for Normalized<'tcx, T> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "Normalized({:?},{:?})", self.value, self.obligations)
     }
 }
 
 impl<'tcx, O: fmt::Debug> fmt::Debug for traits::Obligation<'tcx, O> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         if ty::tls::with(|tcx| tcx.sess.verbose()) {
             write!(
                 f,
@@ -45,7 +45,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::Vtable<'tcx, N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             super::VtableImpl(ref v) => write!(f, "{:?}", v),
 
@@ -67,7 +67,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableImplData<'tcx, N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "VtableImpl(impl_def_id={:?}, substs={:?}, nested={:?})",
@@ -77,7 +77,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableGeneratorData<'tcx, N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "VtableGenerator(generator_def_id={:?}, substs={:?}, nested={:?})",
@@ -87,7 +87,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableClosureData<'tcx, N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "VtableClosure(closure_def_id={:?}, substs={:?}, nested={:?})",
@@ -97,13 +97,13 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableBuiltinData<N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "VtableBuiltin(nested={:?})", self.nested)
     }
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableAutoImplData<N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "VtableAutoImplData(trait_def_id={:?}, nested={:?})",
@@ -113,7 +113,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableObjectData<'tcx, N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "VtableObject(upcast={:?}, vtable_base={}, nested={:?})",
@@ -123,7 +123,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx, N: fmt::Debug> fmt::Debug for traits::VtableFnPointerData<'tcx, N> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(
             f,
             "VtableFnPointer(fn_ty={:?}, nested={:?})",
@@ -133,13 +133,13 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Debug for traits::FulfillmentError<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "FulfillmentError({:?},{:?})", self.obligation, self.code)
     }
 }
 
 impl<'tcx> fmt::Debug for traits::FulfillmentErrorCode<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             super::CodeSelectionError(ref e) => write!(f, "{:?}", e),
             super::CodeProjectionError(ref e) => write!(f, "{:?}", e),
@@ -152,7 +152,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Debug for traits::MismatchedProjectionTypes<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "MismatchedProjectionTypes({:?})", self.err)
     }
 }
@@ -409,7 +409,7 @@ impl<'tcx, T> TypeFoldable<'tcx> for Normalized<'tcx, T> {
 }
 
 impl<'tcx> fmt::Display for traits::WhereClause<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::WhereClause::*;
 
         match self {
@@ -422,7 +422,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for traits::WellFormed<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::WellFormed::*;
 
         match self {
@@ -433,7 +433,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for traits::FromEnv<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::FromEnv::*;
 
         match self {
@@ -444,7 +444,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for traits::DomainGoal<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::DomainGoal::*;
 
         match self {
@@ -457,7 +457,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Display for traits::QuantifierKind {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::QuantifierKind::*;
 
         match self {
@@ -468,7 +468,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for traits::Goal<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::Goal::*;
 
         match self {
@@ -495,7 +495,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for traits::ProgramClause<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         let traits::ProgramClause { goal, hypotheses } = self;
         write!(fmt, "{}", goal)?;
         if !hypotheses.is_empty() {
@@ -512,7 +512,7 @@ fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for traits::Clause<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         use traits::Clause::*;
 
         match self {
index 45280402e489be43d71963999e2ce06a4d8a480e..ae87d30ec942711254f433149c21612809efe235 100644 (file)
@@ -320,7 +320,7 @@ impl<$($typaram ),*> Decoder for $DecoderName<$($typaram),*> {
                     read_f64 -> f64;
                     read_f32 -> f32;
                     read_char -> char;
-                    read_str -> Cow<str>;
+                    read_str -> Cow<'_, str>;
                 }
 
                 fn error(&mut self, err: &str) -> Self::Error {
@@ -417,4 +417,3 @@ fn specialized_decode(
         }
     }
 }
-
index 9195a426bee8fa33004d1983fbfb5f3532b3511e..c288285f2bb3f1e95c762bc187d4cf4ec5600a8c 100644 (file)
@@ -301,7 +301,7 @@ pub fn get(&self, id: hir::HirId) -> Option<&V> {
         self.data.get(&id.local_id)
     }
 
-    pub fn iter(&self) -> hash_map::Iter<hir::ItemLocalId, V> {
+    pub fn iter(&self) -> hash_map::Iter<'_, hir::ItemLocalId, V> {
         self.data.iter()
     }
 }
@@ -325,7 +325,7 @@ pub fn get_mut(&mut self, id: hir::HirId) -> Option<&mut V> {
         self.data.get_mut(&id.local_id)
     }
 
-    pub fn entry(&mut self, id: hir::HirId) -> Entry<hir::ItemLocalId, V> {
+    pub fn entry(&mut self, id: hir::HirId) -> Entry<'_, hir::ItemLocalId, V> {
         validate_hir_id_for_typeck_tables(self.local_id_root, id, true);
         self.data.entry(id.local_id)
     }
@@ -483,56 +483,56 @@ pub fn qpath_def(&self, qpath: &hir::QPath, id: hir::HirId) -> Def {
         }
     }
 
-    pub fn type_dependent_defs(&self) -> LocalTableInContext<Def> {
+    pub fn type_dependent_defs(&self) -> LocalTableInContext<'_, Def> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.type_dependent_defs
         }
     }
 
-    pub fn type_dependent_defs_mut(&mut self) -> LocalTableInContextMut<Def> {
+    pub fn type_dependent_defs_mut(&mut self) -> LocalTableInContextMut<'_, Def> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.type_dependent_defs
         }
     }
 
-    pub fn field_indices(&self) -> LocalTableInContext<usize> {
+    pub fn field_indices(&self) -> LocalTableInContext<'_, usize> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.field_indices
         }
     }
 
-    pub fn field_indices_mut(&mut self) -> LocalTableInContextMut<usize> {
+    pub fn field_indices_mut(&mut self) -> LocalTableInContextMut<'_, usize> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.field_indices
         }
     }
 
-    pub fn user_provided_tys(&self) -> LocalTableInContext<CanonicalTy<'tcx>> {
+    pub fn user_provided_tys(&self) -> LocalTableInContext<'_, CanonicalTy<'tcx>> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.user_provided_tys
         }
     }
 
-    pub fn user_provided_tys_mut(&mut self) -> LocalTableInContextMut<CanonicalTy<'tcx>> {
+    pub fn user_provided_tys_mut(&mut self) -> LocalTableInContextMut<'_, CanonicalTy<'tcx>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.user_provided_tys
         }
     }
 
-    pub fn node_types(&self) -> LocalTableInContext<Ty<'tcx>> {
+    pub fn node_types(&self) -> LocalTableInContext<'_, Ty<'tcx>> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.node_types
         }
     }
 
-    pub fn node_types_mut(&mut self) -> LocalTableInContextMut<Ty<'tcx>> {
+    pub fn node_types_mut(&mut self) -> LocalTableInContextMut<'_, Ty<'tcx>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.node_types
@@ -557,7 +557,7 @@ pub fn node_id_to_type_opt(&self, id: hir::HirId) -> Option<Ty<'tcx>> {
         self.node_types.get(&id.local_id).cloned()
     }
 
-    pub fn node_substs_mut(&mut self) -> LocalTableInContextMut<&'tcx Substs<'tcx>> {
+    pub fn node_substs_mut(&mut self) -> LocalTableInContextMut<'_, &'tcx Substs<'tcx>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.node_substs
@@ -574,7 +574,7 @@ pub fn node_substs_opt(&self, id: hir::HirId) -> Option<&'tcx Substs<'tcx>> {
         self.node_substs.get(&id.local_id).cloned()
     }
 
-    pub fn user_substs_mut(&mut self) -> LocalTableInContextMut<CanonicalSubsts<'tcx>> {
+    pub fn user_substs_mut(&mut self) -> LocalTableInContextMut<'_, CanonicalSubsts<'tcx>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.user_substs
@@ -614,7 +614,7 @@ pub fn expr_ty_opt(&self, expr: &hir::Expr) -> Option<Ty<'tcx>> {
         self.node_id_to_type_opt(expr.hir_id)
     }
 
-    pub fn adjustments(&self) -> LocalTableInContext<Vec<ty::adjustment::Adjustment<'tcx>>> {
+    pub fn adjustments(&self) -> LocalTableInContext<'_, Vec<ty::adjustment::Adjustment<'tcx>>> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.adjustments
@@ -622,7 +622,7 @@ pub fn adjustments(&self) -> LocalTableInContext<Vec<ty::adjustment::Adjustment<
     }
 
     pub fn adjustments_mut(&mut self)
-                           -> LocalTableInContextMut<Vec<ty::adjustment::Adjustment<'tcx>>> {
+                           -> LocalTableInContextMut<'_, Vec<ty::adjustment::Adjustment<'tcx>>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.adjustments
@@ -663,7 +663,7 @@ pub fn is_method_call(&self, expr: &hir::Expr) -> bool {
         }
     }
 
-    pub fn pat_binding_modes(&self) -> LocalTableInContext<BindingMode> {
+    pub fn pat_binding_modes(&self) -> LocalTableInContext<'_, BindingMode> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.pat_binding_modes
@@ -671,14 +671,14 @@ pub fn pat_binding_modes(&self) -> LocalTableInContext<BindingMode> {
     }
 
     pub fn pat_binding_modes_mut(&mut self)
-                           -> LocalTableInContextMut<BindingMode> {
+                           -> LocalTableInContextMut<'_, BindingMode> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.pat_binding_modes
         }
     }
 
-    pub fn pat_adjustments(&self) -> LocalTableInContext<Vec<Ty<'tcx>>> {
+    pub fn pat_adjustments(&self) -> LocalTableInContext<'_, Vec<Ty<'tcx>>> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.pat_adjustments,
@@ -686,7 +686,7 @@ pub fn pat_adjustments(&self) -> LocalTableInContext<Vec<Ty<'tcx>>> {
     }
 
     pub fn pat_adjustments_mut(&mut self)
-                           -> LocalTableInContextMut<Vec<Ty<'tcx>>> {
+                           -> LocalTableInContextMut<'_, Vec<Ty<'tcx>>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.pat_adjustments,
@@ -697,56 +697,56 @@ pub fn upvar_capture(&self, upvar_id: ty::UpvarId) -> ty::UpvarCapture<'tcx> {
         self.upvar_capture_map[&upvar_id]
     }
 
-    pub fn closure_kind_origins(&self) -> LocalTableInContext<(Span, ast::Name)> {
+    pub fn closure_kind_origins(&self) -> LocalTableInContext<'_, (Span, ast::Name)> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.closure_kind_origins
         }
     }
 
-    pub fn closure_kind_origins_mut(&mut self) -> LocalTableInContextMut<(Span, ast::Name)> {
+    pub fn closure_kind_origins_mut(&mut self) -> LocalTableInContextMut<'_, (Span, ast::Name)> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.closure_kind_origins
         }
     }
 
-    pub fn liberated_fn_sigs(&self) -> LocalTableInContext<ty::FnSig<'tcx>> {
+    pub fn liberated_fn_sigs(&self) -> LocalTableInContext<'_, ty::FnSig<'tcx>> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.liberated_fn_sigs
         }
     }
 
-    pub fn liberated_fn_sigs_mut(&mut self) -> LocalTableInContextMut<ty::FnSig<'tcx>> {
+    pub fn liberated_fn_sigs_mut(&mut self) -> LocalTableInContextMut<'_, ty::FnSig<'tcx>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.liberated_fn_sigs
         }
     }
 
-    pub fn fru_field_types(&self) -> LocalTableInContext<Vec<Ty<'tcx>>> {
+    pub fn fru_field_types(&self) -> LocalTableInContext<'_, Vec<Ty<'tcx>>> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.fru_field_types
         }
     }
 
-    pub fn fru_field_types_mut(&mut self) -> LocalTableInContextMut<Vec<Ty<'tcx>>> {
+    pub fn fru_field_types_mut(&mut self) -> LocalTableInContextMut<'_, Vec<Ty<'tcx>>> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.fru_field_types
         }
     }
 
-    pub fn cast_kinds(&self) -> LocalTableInContext<ty::cast::CastKind> {
+    pub fn cast_kinds(&self) -> LocalTableInContext<'_, ty::cast::CastKind> {
         LocalTableInContext {
             local_id_root: self.local_id_root,
             data: &self.cast_kinds
         }
     }
 
-    pub fn cast_kinds_mut(&mut self) -> LocalTableInContextMut<ty::cast::CastKind> {
+    pub fn cast_kinds_mut(&mut self) -> LocalTableInContextMut<'_, ty::cast::CastKind> {
         LocalTableInContextMut {
             local_id_root: self.local_id_root,
             data: &mut self.cast_kinds
@@ -831,10 +831,11 @@ fn new(interners: &CtxtInterners<'tcx>) -> CommonTypes<'tcx> {
         // Ensure our type representation does not grow
         #[cfg(target_pointer_width = "64")]
         #[allow(dead_code)]
-        static ASSERT_TY_KIND: () = [()][!(::std::mem::size_of::<ty::TyKind>() <= 24) as usize];
+        static ASSERT_TY_KIND: () =
+            [()][!(::std::mem::size_of::<ty::TyKind<'_>>() <= 24) as usize];
         #[cfg(target_pointer_width = "64")]
         #[allow(dead_code)]
-        static ASSERT_TYS: () = [()][!(::std::mem::size_of::<ty::TyS>() <= 32) as usize];
+        static ASSERT_TYS: () = [()][!(::std::mem::size_of::<ty::TyS<'_>>() <= 32) as usize];
 
         let mk = |sty| CtxtInterners::intern_ty(interners, interners, sty);
         let mk_region = |r| {
@@ -2007,7 +2008,7 @@ fn get_tlv() -> usize {
 
     /// This is a callback from libsyntax as it cannot access the implicit state
     /// in librustc otherwise
-    fn span_debug(span: syntax_pos::Span, f: &mut fmt::Formatter) -> fmt::Result {
+    fn span_debug(span: syntax_pos::Span, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         with(|tcx| {
             write!(f, "{}", tcx.sess.source_map().span_to_string(span))
         })
@@ -2130,9 +2131,9 @@ pub fn with_context_opt<F, R>(f: F) -> R
         } else {
             // We could get a ImplicitCtxt pointer from another thread.
             // Ensure that ImplicitCtxt is Sync
-            sync::assert_sync::<ImplicitCtxt>();
+            sync::assert_sync::<ImplicitCtxt<'_, '_, '_>>();
 
-            unsafe { f(Some(&*(context as *const ImplicitCtxt))) }
+            unsafe { f(Some(&*(context as *const ImplicitCtxt<'_, '_, '_>))) }
         }
     }
 
@@ -2156,7 +2157,7 @@ pub fn with_related_context<'a, 'gcx, 'tcx1, F, R>(tcx: TyCtxt<'a, 'gcx, 'tcx1>,
             unsafe {
                 let gcx = tcx.gcx as *const _ as usize;
                 assert!(context.tcx.gcx as *const _ as usize == gcx);
-                let context: &ImplicitCtxt = mem::transmute(context);
+                let context: &ImplicitCtxt<'_, '_, '_> = mem::transmute(context);
                 f(context)
             }
         })
@@ -2176,7 +2177,7 @@ pub fn with_fully_related_context<'a, 'gcx, 'tcx, F, R>(tcx: TyCtxt<'a, 'gcx, 't
                 let interners = tcx.interners as *const _ as usize;
                 assert!(context.tcx.gcx as *const _ as usize == gcx);
                 assert!(context.tcx.interners as *const _ as usize == interners);
-                let context: &ImplicitCtxt = mem::transmute(context);
+                let context: &ImplicitCtxt<'_, '_, '_> = mem::transmute(context);
                 f(context)
             }
         })
@@ -2216,7 +2217,7 @@ struct DebugStat {
                 both_infer: usize,
             }
 
-            pub fn go(tcx: TyCtxt) {
+            pub fn go(tcx: TyCtxt<'_, '_, '_>) {
                 let mut total = DebugStat {
                     total: 0,
                     region_infer: 0, ty_infer: 0, both_infer: 0,
@@ -2458,7 +2459,7 @@ pub fn keep_local<'tcx, T: ty::TypeFoldable<'tcx>>(x: &T) -> bool {
 
 direct_interners!('tcx,
     region: mk_region(|r: &RegionKind| r.keep_in_local_tcx()) -> RegionKind,
-    const_: mk_const(|c: &Const| keep_local(&c.ty) || keep_local(&c.val)) -> Const<'tcx>
+    const_: mk_const(|c: &Const<'_>| keep_local(&c.ty) || keep_local(&c.val)) -> Const<'tcx>
 );
 
 macro_rules! slice_interners {
@@ -2467,7 +2468,7 @@ macro_rules! slice_interners {
             &[$ty<'tcx>],
             |a, v| List::from_arena(a, v),
             Deref::deref,
-            |xs: &[$ty]| xs.iter().any(keep_local)) -> List<$ty<'tcx>>);)+
+            |xs: &[$ty<'_>]| xs.iter().any(keep_local)) -> List<$ty<'tcx>>);)+
     )
 }
 
@@ -2857,7 +2858,7 @@ pub fn mk_goals<I: InternAs<[Goal<'tcx>], Goals<'tcx>>>(self, iter: I) -> I::Out
         iter.intern_with(|xs| self.intern_goals(xs))
     }
 
-    pub fn mk_goal(self, goal: Goal<'tcx>) -> &'tcx Goal {
+    pub fn mk_goal(self, goal: Goal<'tcx>) -> &'tcx Goal<'_> {
         &self.intern_goals(&[goal])[0]
     }
 
@@ -3024,7 +3025,7 @@ fn intern_with<I: Iterator<Item=Self>, F: FnOnce(&[T]) -> R>(iter: I, f: F) -> S
     }
 }
 
-pub fn provide(providers: &mut ty::query::Providers) {
+pub fn provide(providers: &mut ty::query::Providers<'_>) {
     // FIXME(#44234) - almost all of these queries have no sub-queries and
     // therefore no actual inputs, they're just reading tables calculated in
     // resolve! Does this work? Unsure! That's what the issue is about
index 2fb2154ce6ba0f5a3ca0ce277db399af4941cf04..f53e634a044e7814d857f6b2a275e3af04ca97b0 100644 (file)
@@ -11,7 +11,7 @@
 use ty::{self, Ty, TyCtxt};
 use ty::fold::{TypeFolder, TypeFoldable};
 
-pub(super) fn provide(providers: &mut ty::query::Providers) {
+pub(super) fn provide(providers: &mut ty::query::Providers<'_>) {
     *providers = ty::query::Providers {
         erase_regions_ty,
         ..*providers
index 2b833c57140b4808d3354e0ad7429ee4965f1d69..9f9d918415e7e8221bb414a393bdb736829b85e1 100644 (file)
@@ -68,9 +68,9 @@ pub enum UnconstrainedNumeric {
 /// afterwards to present additional details, particularly when it comes to lifetime-related
 /// errors.
 impl<'tcx> fmt::Display for TypeError<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         use self::TypeError::*;
-        fn report_maybe_different(f: &mut fmt::Formatter,
+        fn report_maybe_different(f: &mut fmt::Formatter<'_>,
                                   expected: String, found: String) -> fmt::Result {
             // A naive approach to making sure that we're not reporting silly errors such as:
             // (expected closure, found closure).
@@ -237,7 +237,7 @@ pub fn sort_string(&self, tcx: TyCtxt<'a, 'gcx, 'lcx>) -> String {
 
 impl<'a, 'gcx, 'tcx> TyCtxt<'a, 'gcx, 'tcx> {
     pub fn note_and_explain_type_err(self,
-                                     db: &mut DiagnosticBuilder,
+                                     db: &mut DiagnosticBuilder<'_>,
                                      err: &TypeError<'tcx>,
                                      sp: Span) {
         use self::TypeError::*;
index 22a77bd6253c88eac9fae621d4b183aea9f98219..2d055fd307dc440029ec65e495d2234c10ea25f0 100644 (file)
@@ -63,7 +63,7 @@ pub enum SimplifiedTypeGen<D>
 /// `can_simplify_params` should be true if type parameters appear free in `ty` and `false` if they
 /// are to be considered bound.
 pub fn simplify_type<'a, 'gcx, 'tcx>(tcx: TyCtxt<'a, 'gcx, 'tcx>,
-                                     ty: Ty,
+                                     ty: Ty<'_>,
                                      can_simplify_params: bool)
                                      -> Option<SimplifiedType>
 {
index 341ce40d153b0c8dddde45f254485bbaf9be55c8..08d10578238737b21a28118b489dfd33f90ce252 100644 (file)
@@ -28,7 +28,7 @@ fn new() -> FlagComputation {
         }
     }
 
-    pub fn for_sty(st: &ty::TyKind) -> FlagComputation {
+    pub fn for_sty(st: &ty::TyKind<'_>) -> FlagComputation {
         let mut result = FlagComputation::new();
         result.add_sty(st);
         result
@@ -67,7 +67,7 @@ fn add_bound_computation(&mut self, computation: &FlagComputation) {
         }
     }
 
-    fn add_sty(&mut self, st: &ty::TyKind) {
+    fn add_sty(&mut self, st: &ty::TyKind<'_>) {
         match st {
             &ty::Bool |
             &ty::Char |
@@ -204,18 +204,18 @@ fn add_sty(&mut self, st: &ty::TyKind) {
         }
     }
 
-    fn add_ty(&mut self, ty: Ty) {
+    fn add_ty(&mut self, ty: Ty<'_>) {
         self.add_flags(ty.flags);
         self.add_exclusive_binder(ty.outer_exclusive_binder);
     }
 
-    fn add_tys(&mut self, tys: &[Ty]) {
+    fn add_tys(&mut self, tys: &[Ty<'_>]) {
         for &ty in tys {
             self.add_ty(ty);
         }
     }
 
-    fn add_fn_sig(&mut self, fn_sig: ty::PolyFnSig) {
+    fn add_fn_sig(&mut self, fn_sig: ty::PolyFnSig<'_>) {
         let mut computation = FlagComputation::new();
 
         computation.add_tys(fn_sig.skip_binder().inputs());
@@ -224,14 +224,14 @@ fn add_fn_sig(&mut self, fn_sig: ty::PolyFnSig) {
         self.add_bound_computation(&computation);
     }
 
-    fn add_region(&mut self, r: ty::Region) {
+    fn add_region(&mut self, r: ty::Region<'_>) {
         self.add_flags(r.type_flags());
         if let ty::ReLateBound(debruijn, _) = *r {
             self.add_binder(debruijn);
         }
     }
 
-    fn add_const(&mut self, constant: &ty::Const) {
+    fn add_const(&mut self, constant: &ty::Const<'_>) {
         self.add_ty(constant.ty);
         if let ConstValue::Unevaluated(_, substs) = constant.val {
             self.add_flags(TypeFlags::HAS_PROJECTION);
@@ -239,16 +239,16 @@ fn add_const(&mut self, constant: &ty::Const) {
         }
     }
 
-    fn add_existential_projection(&mut self, projection: &ty::ExistentialProjection) {
+    fn add_existential_projection(&mut self, projection: &ty::ExistentialProjection<'_>) {
         self.add_substs(projection.substs);
         self.add_ty(projection.ty);
     }
 
-    fn add_projection_ty(&mut self, projection_ty: &ty::ProjectionTy) {
+    fn add_projection_ty(&mut self, projection_ty: &ty::ProjectionTy<'_>) {
         self.add_substs(projection_ty.substs);
     }
 
-    fn add_substs(&mut self, substs: &Substs) {
+    fn add_substs(&mut self, substs: &Substs<'_>) {
         for ty in substs.types() {
             self.add_ty(ty);
         }
index a661125d1ca03441601dbd08d2c86c494a46d1ab..6bf493b496c8b92b60a9d1b358a5bdcfdbc7bb11 100644 (file)
@@ -708,7 +708,7 @@ struct HasTypeFlagsVisitor {
 }
 
 impl<'tcx> TypeVisitor<'tcx> for HasTypeFlagsVisitor {
-    fn visit_ty(&mut self, t: Ty) -> bool {
+    fn visit_ty(&mut self, t: Ty<'_>) -> bool {
         debug!("HasTypeFlagsVisitor: t={:?} t.flags={:?} self.flags={:?}", t, t.flags, self.flags);
         t.flags.intersects(self.flags)
     }
index 68996f52b867a27adf6fd88dd9c2c264c8a35baa..a6e181a26f420479b14f8e753866d1f78de7f5bd 100644 (file)
@@ -114,7 +114,7 @@ pub fn requires_local<'a>(
 }
 
 impl<'tcx> fmt::Display for Instance<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         ppaux::parameterized(f, self.substs, self.def_id(), &[])?;
         match self.def {
             InstanceDef::Item(_) => Ok(()),
index 0272865bda45bc9bde1166bb720fa2ec8f02f3c6..1b4ff18f6b8d8fff3c3040309fb093b318c0da5b 100644 (file)
@@ -355,7 +355,7 @@ pub fn parent_def_id(self, def_id: DefId) -> Option<DefId> {
 /// function tries to find a "characteristic def-id" for a
 /// type. It's just a heuristic so it makes some questionable
 /// decisions and we may want to adjust it later.
-pub fn characteristic_def_id_of_type(ty: Ty) -> Option<DefId> {
+pub fn characteristic_def_id_of_type(ty: Ty<'_>) -> Option<DefId> {
     match ty.sty {
         ty::Adt(adt_def, _) => Some(adt_def.did),
 
index 4e37a34a0c8a7f9af70d13a8f8d1cd8a790a3003..e756313a1253db3bae0d45bf2830ac8e7c325a49 100644 (file)
@@ -157,7 +157,7 @@ pub enum LayoutError<'tcx> {
 }
 
 impl<'tcx> fmt::Display for LayoutError<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             LayoutError::Unknown(ty) => {
                 write!(f, "the type `{:?}` has an unknown layout", ty)
@@ -195,7 +195,7 @@ fn layout_raw<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     })
 }
 
-pub fn provide(providers: &mut ty::query::Providers) {
+pub fn provide(providers: &mut ty::query::Providers<'_>) {
     *providers = ty::query::Providers {
         layout_raw,
         ..*providers
@@ -250,7 +250,7 @@ enum StructKind {
             /// A univariant, but with a prefix of an arbitrary size & alignment (e.g. enum tag).
             Prefixed(Size, Align),
         }
-        let univariant_uninterned = |fields: &[TyLayout], repr: &ReprOptions, kind| {
+        let univariant_uninterned = |fields: &[TyLayout<'_>], repr: &ReprOptions, kind| {
             let packed = repr.packed();
             if packed && repr.align > 0 {
                 bug!("struct cannot be packed and aligned");
@@ -283,7 +283,7 @@ enum StructKind {
                     fields.len()
                 };
                 let optimizing = &mut inverse_memory_index[..end];
-                let field_align = |f: &TyLayout| {
+                let field_align = |f: &TyLayout<'_>| {
                     if packed { f.align.min(pack).abi() } else { f.align.abi() }
                 };
                 match kind {
@@ -464,7 +464,7 @@ enum StructKind {
                 size
             })
         };
-        let univariant = |fields: &[TyLayout], repr: &ReprOptions, kind| {
+        let univariant = |fields: &[TyLayout<'_>], repr: &ReprOptions, kind| {
             Ok(tcx.intern_layout(univariant_uninterned(fields, repr, kind)?))
         };
         debug_assert!(!ty.has_infer_types());
@@ -723,7 +723,7 @@ enum StructKind {
                 // but *not* an encoding of the discriminant (e.g. a tag value).
                 // See issue #49298 for more details on the need to leave space
                 // for non-ZST uninhabited data (mostly partial initialization).
-                let absent = |fields: &[TyLayout]| {
+                let absent = |fields: &[TyLayout<'_>]| {
                     let uninhabited = fields.iter().any(|f| f.abi == Abi::Uninhabited);
                     let is_zst = fields.iter().all(|f| f.is_zst());
                     uninhabited && is_zst
@@ -1403,7 +1403,7 @@ pub fn compute(ty: Ty<'tcx>,
         }
     }
 
-    pub fn same_size(self, other: SizeSkeleton) -> bool {
+    pub fn same_size(self, other: SizeSkeleton<'_>) -> bool {
         match (self, other) {
             (SizeSkeleton::Known(a), SizeSkeleton::Known(b)) => a == b,
             (SizeSkeleton::Pointer { tail: a, .. },
index df9335e909bc5e3d3f64950a0a97aae9bae633d2..b2281691bd66089da9269d309bc5583a0a63121a 100644 (file)
@@ -273,7 +273,7 @@ fn parent(self, id: DefId) -> Option<DefId> {
 }
 
 impl Visibility {
-    pub fn from_hir(visibility: &hir::Visibility, id: NodeId, tcx: TyCtxt) -> Self {
+    pub fn from_hir(visibility: &hir::Visibility, id: NodeId, tcx: TyCtxt<'_, '_, '_>) -> Self {
         match visibility.node {
             hir::VisibilityKind::Public => Visibility::Public,
             hir::VisibilityKind::Crate(_) => Visibility::Restricted(DefId::local(CRATE_DEF_INDEX)),
@@ -536,7 +536,7 @@ impl<'tcx> Eq for TyS<'tcx> {}
 
 impl<'tcx> Hash for TyS<'tcx> {
     fn hash<H: Hasher>(&self, s: &mut H) {
-        (self as *const TyS).hash(s)
+        (self as *const TyS<'_>).hash(s)
     }
 }
 
@@ -649,7 +649,7 @@ fn from_arena<'tcx>(arena: &'tcx SyncDroplessArena, slice: &[T]) -> &'tcx List<T
 }
 
 impl<T: fmt::Debug> fmt::Debug for List<T> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         (**self).fmt(f)
     }
 }
@@ -1263,7 +1263,7 @@ pub fn item_def_id(&self) -> DefId {
         self.skip_binder().projection_ty.item_def_id
     }
 
-    pub fn to_poly_trait_ref(&self, tcx: TyCtxt) -> PolyTraitRef<'tcx> {
+    pub fn to_poly_trait_ref(&self, tcx: TyCtxt<'_, '_, '_>) -> PolyTraitRef<'tcx> {
         // Note: unlike with TraitRef::to_poly_trait_ref(),
         // self.0.trait_ref is permitted to have escaping regions.
         // This is because here `self` has a `Binder` and so does our
@@ -1541,7 +1541,7 @@ pub fn as_usize(&self) -> usize {
 }
 
 impl fmt::Debug for UniverseIndex {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(fmt, "U{}", self.as_u32())
     }
 }
@@ -1931,7 +1931,7 @@ pub struct ReprOptions {
 });
 
 impl ReprOptions {
-    pub fn new(tcx: TyCtxt, did: DefId) -> ReprOptions {
+    pub fn new(tcx: TyCtxt<'_, '_, '_>, did: DefId) -> ReprOptions {
         let mut flags = ReprFlags::empty();
         let mut size = None;
         let mut max_align = 0;
@@ -1999,7 +1999,7 @@ pub fn inhibit_struct_field_reordering_opt(&self) -> bool {
 }
 
 impl<'a, 'gcx, 'tcx> AdtDef {
-    fn new(tcx: TyCtxt,
+    fn new(tcx: TyCtxt<'_, '_, '_>,
            did: DefId,
            kind: AdtKind,
            variants: Vec<VariantDef>,
@@ -2644,7 +2644,7 @@ fn associated_item_from_impl_item_ref(self,
         }
     }
 
-    pub fn field_index(self, node_id: NodeId, tables: &TypeckTables) -> usize {
+    pub fn field_index(self, node_id: NodeId, tables: &TypeckTables<'_>) -> usize {
         let hir_id = self.hir.node_to_hir_id(node_id);
         tables.field_indices().get(hir_id).cloned().expect("no index for a field")
     }
@@ -2971,7 +2971,7 @@ fn trait_of_item<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>, def_id: DefId) -> Option
 }
 
 /// Yields the parent function's `DefId` if `def_id` is an `impl Trait` definition
-pub fn is_impl_trait_defn(tcx: TyCtxt, def_id: DefId) -> Option<DefId> {
+pub fn is_impl_trait_defn(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> Option<DefId> {
     if let Some(node_id) = tcx.hir.as_local_node_id(def_id) {
         if let Node::Item(item) = tcx.hir.get(node_id) {
             if let hir::ItemKind::Existential(ref exist_ty) = item.node {
@@ -3051,7 +3051,7 @@ fn instance_def_size_estimate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
     }
 }
 
-pub fn provide(providers: &mut ty::query::Providers) {
+pub fn provide(providers: &mut ty::query::Providers<'_>) {
     context::provide(providers);
     erase_regions::provide(providers);
     layout::provide(providers);
@@ -3106,13 +3106,13 @@ pub fn as_str(&self) -> LocalInternedString {
 }
 
 impl fmt::Display for SymbolName {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt::Display::fmt(&self.name, fmt)
     }
 }
 
 impl fmt::Debug for SymbolName {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         fmt::Display::fmt(&self.name, fmt)
     }
 }
index ca6f0b77b6640b5c5c371792fe0f9e680e4e8b18..0fcaef5de54c2dbaa93b881c9c73d93302647b7a 100644 (file)
@@ -294,7 +294,7 @@ You can put new impls into the `config` module. They look something like this:
 
 ```rust
 impl<'tcx> QueryDescription for queries::type_of<'tcx> {
-    fn describe(tcx: TyCtxt, key: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, key: DefId) -> String {
         format!("computing the type of `{}`", tcx.item_path_str(key))
     }
 }
index 2bbf5aacc1aca85192da2dffc29bf38a3ad04149..9ea655ba6fd5d45402cbd4a72cd5bbcba31fd6bc 100644 (file)
@@ -55,7 +55,7 @@ pub(super) trait QueryAccessors<'tcx>: QueryConfig<'tcx> {
 }
 
 pub(super) trait QueryDescription<'tcx>: QueryAccessors<'tcx> {
-    fn describe(tcx: TyCtxt, key: Self::Key) -> String;
+    fn describe(tcx: TyCtxt<'_, '_, '_>, key: Self::Key) -> String;
 
     #[inline]
     fn cache_on_disk(_: Self::Key) -> bool {
@@ -70,7 +70,7 @@ fn try_load_from_disk(_: TyCtxt<'_, 'tcx, 'tcx>,
 }
 
 impl<'tcx, M: QueryAccessors<'tcx, Key=DefId>> QueryDescription<'tcx> for M {
-    default fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    default fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         if !tcx.sess.verbose() {
             format!("processing `{}`", tcx.item_path_str(def_id))
         } else {
@@ -82,7 +82,7 @@ impl<'tcx, M: QueryAccessors<'tcx, Key=DefId>> QueryDescription<'tcx> for M {
 
 impl<'tcx> QueryDescription<'tcx> for queries::normalize_projection_ty<'tcx> {
     fn describe(
-        _tcx: TyCtxt,
+        _tcx: TyCtxt<'_, '_, '_>,
         goal: CanonicalProjectionGoal<'tcx>,
     ) -> String {
         format!("normalizing `{:?}`", goal)
@@ -90,56 +90,57 @@ fn describe(
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::implied_outlives_bounds<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTyGoal<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTyGoal<'tcx>) -> String {
         format!("computing implied outlives bounds for `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::dropck_outlives<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTyGoal<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTyGoal<'tcx>) -> String {
         format!("computing dropck types for `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::normalize_ty_after_erasing_regions<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
         format!("normalizing `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::evaluate_obligation<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalPredicateGoal<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalPredicateGoal<'tcx>) -> String {
         format!("evaluating trait selection obligation `{}`", goal.value.value)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_eq<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpEqGoal<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTypeOpEqGoal<'tcx>) -> String {
         format!("evaluating `type_op_eq` `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_subtype<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpSubtypeGoal<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTypeOpSubtypeGoal<'tcx>) -> String {
         format!("evaluating `type_op_subtype` `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_prove_predicate<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpProvePredicateGoal<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, goal: CanonicalTypeOpProvePredicateGoal<'tcx>) -> String {
         format!("evaluating `type_op_prove_predicate` `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_ty<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>,
+                goal: CanonicalTypeOpNormalizeGoal<'tcx, Ty<'tcx>>) -> String {
         format!("normalizing `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_predicate<'tcx> {
     fn describe(
-        _tcx: TyCtxt,
+        _tcx: TyCtxt<'_, '_, '_>,
         goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::Predicate<'tcx>>,
     ) -> String {
         format!("normalizing `{:?}`", goal)
@@ -148,7 +149,7 @@ fn describe(
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_poly_fn_sig<'tcx> {
     fn describe(
-        _tcx: TyCtxt,
+        _tcx: TyCtxt<'_, '_, '_>,
         goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::PolyFnSig<'tcx>>,
     ) -> String {
         format!("normalizing `{:?}`", goal)
@@ -156,56 +157,57 @@ fn describe(
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_op_normalize_fn_sig<'tcx> {
-    fn describe(_tcx: TyCtxt, goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::FnSig<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>,
+                goal: CanonicalTypeOpNormalizeGoal<'tcx, ty::FnSig<'tcx>>) -> String {
         format!("normalizing `{:?}`", goal)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_copy_raw<'tcx> {
-    fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
         format!("computing whether `{}` is `Copy`", env.value)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_sized_raw<'tcx> {
-    fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
         format!("computing whether `{}` is `Sized`", env.value)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_freeze_raw<'tcx> {
-    fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
         format!("computing whether `{}` is freeze", env.value)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::needs_drop_raw<'tcx> {
-    fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
         format!("computing whether `{}` needs drop", env.value)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::layout_raw<'tcx> {
-    fn describe(_tcx: TyCtxt, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, env: ty::ParamEnvAnd<'tcx, Ty<'tcx>>) -> String {
         format!("computing layout of `{}`", env.value)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::super_predicates_of<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("computing the supertraits of `{}`",
                 tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::erase_regions_ty<'tcx> {
-    fn describe(_tcx: TyCtxt, ty: Ty<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, ty: Ty<'tcx>) -> String {
         format!("erasing regions from `{:?}`", ty)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::type_param_predicates<'tcx> {
-    fn describe(tcx: TyCtxt, (_, def_id): (DefId, DefId)) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, (_, def_id): (DefId, DefId)) -> String {
         let id = tcx.hir.as_local_node_id(def_id).unwrap();
         format!("computing the bounds for type parameter `{}`",
                 tcx.hir.ty_param_name(id))
@@ -213,69 +215,69 @@ fn describe(tcx: TyCtxt, (_, def_id): (DefId, DefId)) -> String {
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::coherent_trait<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("coherence checking all impls of trait `{}`",
                 tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::upstream_monomorphizations<'tcx> {
-    fn describe(_: TyCtxt, k: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, k: CrateNum) -> String {
         format!("collecting available upstream monomorphizations `{:?}`", k)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::crate_inherent_impls<'tcx> {
-    fn describe(_: TyCtxt, k: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, k: CrateNum) -> String {
         format!("all inherent impls defined in crate `{:?}`", k)
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::crate_inherent_impls_overlap_check<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "check for overlap between inherent impls defined in this crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::crate_variances<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "computing the variances for items in this crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::inferred_outlives_crate<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "computing the inferred outlives predicates for items in this crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::mir_shims<'tcx> {
-    fn describe(tcx: TyCtxt, def: ty::InstanceDef<'tcx>) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def: ty::InstanceDef<'tcx>) -> String {
         format!("generating MIR shim for `{}`",
                 tcx.item_path_str(def.def_id()))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::privacy_access_levels<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "privacy access levels".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::typeck_item_bodies<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "type-checking all item bodies".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::reachable_set<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "reachability".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::const_eval<'tcx> {
-    fn describe(tcx: TyCtxt, key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, key: ty::ParamEnvAnd<'tcx, GlobalId<'tcx>>) -> String {
         format!("const-evaluating `{}`", tcx.item_path_str(key.value.instance.def.def_id()))
     }
 
@@ -293,13 +295,13 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::mir_keys<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "getting a list of all mir_keys".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::symbol_name<'tcx> {
-    fn describe(_tcx: TyCtxt, instance: ty::Instance<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, instance: ty::Instance<'tcx>) -> String {
         format!("computing the symbol for `{}`", instance)
     }
 
@@ -317,62 +319,62 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::describe_def<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("describe_def")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::def_span<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("def_span")
     }
 }
 
 
 impl<'tcx> QueryDescription<'tcx> for queries::lookup_stability<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("stability")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::lookup_deprecation_entry<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("deprecation")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::item_attrs<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("item_attrs")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_reachable_non_generic<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("is_reachable_non_generic")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::fn_arg_names<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("fn_arg_names")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::impl_parent<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("impl_parent")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::trait_of_item<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         bug!("trait_of_item")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::const_is_rvalue_promotable_to_static<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("const checking if rvalue is promotable to static `{}`",
             tcx.item_path_str(def_id))
     }
@@ -391,21 +393,22 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::rvalue_promotable_map<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("checking which parts of `{}` are promotable to static",
                 tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_mir_available<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("checking if item is mir available: `{}`",
             tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::codegen_fulfill_obligation<'tcx> {
-    fn describe(tcx: TyCtxt, key: (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>,
+                key: (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>)) -> String {
         format!("checking if `{}` fulfills its obligations", tcx.item_path_str(key.1.def_id()))
     }
 
@@ -423,319 +426,319 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::trait_impls_of<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("trait impls of `{}`", tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_object_safe<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("determine object safety of trait `{}`", tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_const_fn<'tcx> {
-    fn describe(tcx: TyCtxt, def_id: DefId) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> String {
         format!("checking if item is const fn: `{}`", tcx.item_path_str(def_id))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::dylib_dependency_formats<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "dylib dependency formats of crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_panic_runtime<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "checking if the crate is_panic_runtime".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_compiler_builtins<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "checking if the crate is_compiler_builtins".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::has_global_allocator<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "checking if the crate has_global_allocator".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::has_panic_handler<'tcx> {
-    fn describe(_: TyCtxt, _: CrateNum) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "checking if the crate has_panic_handler".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::extern_crate<'tcx> {
-    fn describe(_: TyCtxt, _: DefId) -> String {
+    fn describe(_: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         "getting crate's ExternCrateData".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::lint_levels<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "computing the lint levels for items in this crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::specializes<'tcx> {
-    fn describe(_tcx: TyCtxt, _: (DefId, DefId)) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: (DefId, DefId)) -> String {
         "computing whether impls specialize one another".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::in_scope_traits_map<'tcx> {
-    fn describe(_tcx: TyCtxt, _: DefIndex) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefIndex) -> String {
         "traits in scope at a block".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_no_builtins<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "test whether a crate has #![no_builtins]".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::panic_strategy<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "query a crate's configured panic strategy".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_profiler_runtime<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "query a crate is #![profiler_runtime]".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_sanitizer_runtime<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "query a crate is #![sanitizer_runtime]".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::reachable_non_generics<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the exported symbols of a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::native_libraries<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the native libraries of a linked crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::foreign_modules<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the foreign modules of a linked crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::plugin_registrar_fn<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the plugin registrar for a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::derive_registrar_fn<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the derive registrar for a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::crate_disambiguator<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the disambiguator a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::crate_hash<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the hash a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::original_crate_name<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the original name a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::extra_filename<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the extra filename for a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::implementations_of_trait<'tcx> {
-    fn describe(_tcx: TyCtxt, _: (CrateNum, DefId)) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: (CrateNum, DefId)) -> String {
         "looking up implementations of a trait in a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::all_trait_implementations<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up all (?) trait implementations".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::link_args<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up link arguments for a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::resolve_lifetimes<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "resolving lifetimes".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::named_region_map<'tcx> {
-    fn describe(_tcx: TyCtxt, _: DefIndex) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefIndex) -> String {
         "looking up a named region".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::is_late_bound_map<'tcx> {
-    fn describe(_tcx: TyCtxt, _: DefIndex) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefIndex) -> String {
         "testing if a region is late bound".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::object_lifetime_defaults_map<'tcx> {
-    fn describe(_tcx: TyCtxt, _: DefIndex) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefIndex) -> String {
         "looking up lifetime defaults for a region".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::dep_kind<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "fetching what a dependency looks like".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::crate_name<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "fetching what a crate is named".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::get_lib_features<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         format!("calculating the lib features map")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::defined_lib_features<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         format!("calculating the lib features defined in a crate")
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::get_lang_items<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "calculating the lang items map".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::defined_lang_items<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "calculating the lang items defined in a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::missing_lang_items<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "calculating the missing lang items in a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::visible_parent_map<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "calculating the visible parent map".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::missing_extern_crate_item<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "seeing if we're missing an `extern crate` item for this crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::used_crate_source<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking at the source for a crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::postorder_cnums<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "generating a postorder list of CrateNums".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::maybe_unused_extern_crates<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up all possibly unused extern crates".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::stability_index<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "calculating the stability index for the local crate".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::all_traits<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "fetching all foreign and local traits".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::all_crate_nums<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "fetching all foreign CrateNum instances".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::exported_symbols<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "exported_symbols".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::collect_and_partition_mono_items<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "collect_and_partition_mono_items".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::codegen_unit<'tcx> {
-    fn describe(_tcx: TyCtxt, _: InternedString) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: InternedString) -> String {
         "codegen_unit".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::output_filenames<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "output_filenames".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::vtable_methods<'tcx> {
-    fn describe(tcx: TyCtxt, key: ty::PolyTraitRef<'tcx> ) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, key: ty::PolyTraitRef<'tcx> ) -> String {
         format!("finding all methods for trait {}", tcx.item_path_str(key.def_id()))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::features_query<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up enabled feature gates".to_string()
     }
 }
@@ -773,19 +776,19 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::substitute_normalize_and_test_predicates<'tcx> {
-    fn describe(tcx: TyCtxt, key: (DefId, &'tcx Substs<'tcx>)) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, key: (DefId, &'tcx Substs<'tcx>)) -> String {
         format!("testing substituted normalized predicates:`{}`", tcx.item_path_str(key.0))
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::target_features_whitelist<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "looking up the whitelist of target features".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::instance_def_size_estimate<'tcx> {
-    fn describe(tcx: TyCtxt, def: ty::InstanceDef<'tcx>) -> String {
+    fn describe(tcx: TyCtxt<'_, '_, '_>, def: ty::InstanceDef<'tcx>) -> String {
         format!("estimating size for `{}`", tcx.item_path_str(def.def_id()))
     }
 }
@@ -806,25 +809,25 @@ fn try_load_from_disk<'a>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::program_clauses_for<'tcx> {
-    fn describe(_tcx: TyCtxt, _: DefId) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: DefId) -> String {
         "generating chalk-style clauses".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::program_clauses_for_env<'tcx> {
-    fn describe(_tcx: TyCtxt, _: ty::ParamEnv<'tcx>) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: ty::ParamEnv<'tcx>) -> String {
         "generating chalk-style clauses for param env".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::wasm_import_module_map<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "wasm import module map".to_string()
     }
 }
 
 impl<'tcx> QueryDescription<'tcx> for queries::dllimport_foreign_items<'tcx> {
-    fn describe(_tcx: TyCtxt, _: CrateNum) -> String {
+    fn describe(_tcx: TyCtxt<'_, '_, '_>, _: CrateNum) -> String {
         "wasm import module map".to_string()
     }
 }
index 8423b02ee7582d2e73f74f30ba285592aeffba3b..96b0a768001a83b737764b8c7e6d96ac823646b5 100644 (file)
@@ -31,7 +31,7 @@ pub(super) trait Key: Clone + Hash + Eq + Debug {
 
     /// In the event that a cycle occurs, if no explicit span has been
     /// given for a query with key `self`, what span should we use?
-    fn default_span(&self, tcx: TyCtxt) -> Span;
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span;
 }
 
 impl<'tcx> Key for ty::InstanceDef<'tcx> {
@@ -39,7 +39,7 @@ fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
 
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         tcx.def_span(self.def_id())
     }
 }
@@ -49,7 +49,7 @@ fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
 
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         tcx.def_span(self.def_id())
     }
 }
@@ -59,7 +59,7 @@ fn query_crate(&self) -> CrateNum {
         self.instance.query_crate()
     }
 
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         self.instance.default_span(tcx)
     }
 }
@@ -68,7 +68,7 @@ impl Key for CrateNum {
     fn query_crate(&self) -> CrateNum {
         *self
     }
-    fn default_span(&self, _: TyCtxt) -> Span {
+    fn default_span(&self, _: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
@@ -77,7 +77,7 @@ impl Key for DefIndex {
     fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
-    fn default_span(&self, _tcx: TyCtxt) -> Span {
+    fn default_span(&self, _tcx: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
@@ -86,7 +86,7 @@ impl Key for DefId {
     fn query_crate(&self) -> CrateNum {
         self.krate
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         tcx.def_span(*self)
     }
 }
@@ -95,7 +95,7 @@ impl Key for (DefId, DefId) {
     fn query_crate(&self) -> CrateNum {
         self.0.krate
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         self.1.default_span(tcx)
     }
 }
@@ -104,7 +104,7 @@ impl Key for (CrateNum, DefId) {
     fn query_crate(&self) -> CrateNum {
         self.0
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         self.1.default_span(tcx)
     }
 }
@@ -113,7 +113,7 @@ impl Key for (DefId, SimplifiedType) {
     fn query_crate(&self) -> CrateNum {
         self.0.krate
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         self.0.default_span(tcx)
     }
 }
@@ -122,7 +122,7 @@ impl<'tcx> Key for (DefId, &'tcx Substs<'tcx>) {
     fn query_crate(&self) -> CrateNum {
         self.0.krate
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         self.0.default_span(tcx)
     }
 }
@@ -131,7 +131,7 @@ impl<'tcx> Key for (ty::ParamEnv<'tcx>, ty::PolyTraitRef<'tcx>) {
     fn query_crate(&self) -> CrateNum {
         self.1.def_id().krate
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         tcx.def_span(self.1.def_id())
     }
 }
@@ -140,7 +140,7 @@ impl<'tcx> Key for ty::PolyTraitRef<'tcx>{
     fn query_crate(&self) -> CrateNum {
         self.def_id().krate
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         tcx.def_span(self.def_id())
     }
 }
@@ -149,7 +149,7 @@ impl<'tcx> Key for &'tcx ty::Const<'tcx> {
     fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
-    fn default_span(&self, _: TyCtxt) -> Span {
+    fn default_span(&self, _: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
@@ -158,7 +158,7 @@ impl<'tcx> Key for Ty<'tcx> {
     fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
-    fn default_span(&self, _: TyCtxt) -> Span {
+    fn default_span(&self, _: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
@@ -167,7 +167,7 @@ impl<'tcx> Key for ty::ParamEnv<'tcx> {
     fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
-    fn default_span(&self, _: TyCtxt) -> Span {
+    fn default_span(&self, _: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
@@ -176,7 +176,7 @@ impl<'tcx, T: Key> Key for ty::ParamEnvAnd<'tcx, T> {
     fn query_crate(&self) -> CrateNum {
         self.value.query_crate()
     }
-    fn default_span(&self, tcx: TyCtxt) -> Span {
+    fn default_span(&self, tcx: TyCtxt<'_, '_, '_>) -> Span {
         self.value.default_span(tcx)
     }
 }
@@ -185,7 +185,7 @@ impl Key for InternedString {
     fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
-    fn default_span(&self, _tcx: TyCtxt) -> Span {
+    fn default_span(&self, _tcx: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
@@ -200,7 +200,7 @@ fn query_crate(&self) -> CrateNum {
         LOCAL_CRATE
     }
 
-    fn default_span(&self, _tcx: TyCtxt) -> Span {
+    fn default_span(&self, _tcx: TyCtxt<'_, '_, '_>) -> Span {
         DUMMY_SP
     }
 }
index 79c7e517273fc72c6764ba16303abeda4417beb4..e0a503a9cebf51e57c2df7764b0f2626411f4227 100644 (file)
@@ -666,21 +666,21 @@ pub fn try_adt_sized_constraint(
         span: Span,
         key: DefId,
     ) -> Result<&'tcx [Ty<'tcx>], DiagnosticBuilder<'a>> {
-        self.try_get_query::<queries::adt_sized_constraint>(span, key)
+        self.try_get_query::<queries::adt_sized_constraint<'_>>(span, key)
     }
     pub fn try_needs_drop_raw(
         self,
         span: Span,
         key: ty::ParamEnvAnd<'tcx, Ty<'tcx>>,
     ) -> Result<bool, DiagnosticBuilder<'a>> {
-        self.try_get_query::<queries::needs_drop_raw>(span, key)
+        self.try_get_query::<queries::needs_drop_raw<'_>>(span, key)
     }
     pub fn try_optimized_mir(
         self,
         span: Span,
         key: DefId,
     ) -> Result<&'tcx mir::Mir<'tcx>, DiagnosticBuilder<'a>> {
-        self.try_get_query::<queries::optimized_mir>(span, key)
+        self.try_get_query::<queries::optimized_mir<'_>>(span, key)
     }
 }
 
index 296602e21bad74f13c0871478811dc8eb62adfdb..bb877864632237effd2ddd6921e7d8c02a99313c 100644 (file)
@@ -212,23 +212,23 @@ pub fn serialize<'a, 'tcx, E>(&self,
                 let enc = &mut encoder;
                 let qri = &mut query_result_index;
 
-                encode_query_results::<type_of, _>(tcx, enc, qri)?;
-                encode_query_results::<generics_of, _>(tcx, enc, qri)?;
-                encode_query_results::<predicates_of, _>(tcx, enc, qri)?;
-                encode_query_results::<used_trait_imports, _>(tcx, enc, qri)?;
-                encode_query_results::<typeck_tables_of, _>(tcx, enc, qri)?;
-                encode_query_results::<codegen_fulfill_obligation, _>(tcx, enc, qri)?;
-                encode_query_results::<optimized_mir, _>(tcx, enc, qri)?;
-                encode_query_results::<unsafety_check_result, _>(tcx, enc, qri)?;
-                encode_query_results::<borrowck, _>(tcx, enc, qri)?;
-                encode_query_results::<mir_borrowck, _>(tcx, enc, qri)?;
-                encode_query_results::<mir_const_qualif, _>(tcx, enc, qri)?;
-                encode_query_results::<def_symbol_name, _>(tcx, enc, qri)?;
-                encode_query_results::<const_is_rvalue_promotable_to_static, _>(tcx, enc, qri)?;
-                encode_query_results::<symbol_name, _>(tcx, enc, qri)?;
-                encode_query_results::<check_match, _>(tcx, enc, qri)?;
-                encode_query_results::<codegen_fn_attrs, _>(tcx, enc, qri)?;
-                encode_query_results::<specialization_graph_of, _>(tcx, enc, qri)?;
+                encode_query_results::<type_of<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<generics_of<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<predicates_of<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<used_trait_imports<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<typeck_tables_of<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<codegen_fulfill_obligation<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<optimized_mir<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<unsafety_check_result<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<borrowck<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<mir_borrowck<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<mir_const_qualif<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<def_symbol_name<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<const_is_rvalue_promotable_to_static<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<symbol_name<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<check_match<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<codegen_fn_attrs<'_>, _>(tcx, enc, qri)?;
+                encode_query_results::<specialization_graph_of<'_>, _>(tcx, enc, qri)?;
 
                 // const eval is special, it only encodes successfully evaluated constants
                 use ty::query::QueryAccessors;
@@ -323,7 +323,7 @@ pub fn serialize<'a, 'tcx, E>(&self,
 
             return Ok(());
 
-            fn sorted_cnums_including_local_crate(tcx: TyCtxt) -> Vec<CrateNum> {
+            fn sorted_cnums_including_local_crate(tcx: TyCtxt<'_, '_, '_>) -> Vec<CrateNum> {
                 let mut cnums = vec![LOCAL_CRATE];
                 cnums.extend_from_slice(&tcx.crates()[..]);
                 cnums.sort_unstable();
@@ -434,7 +434,7 @@ fn load_indexed<'tcx, T>(&self,
     // current-session-CrateNum. There might be CrateNums from the previous
     // Session that don't occur in the current one. For these, the mapping
     // maps to None.
-    fn compute_cnum_map(tcx: TyCtxt,
+    fn compute_cnum_map(tcx: TyCtxt<'_, '_, '_>,
                         prev_cnums: &[(u32, String, CrateDisambiguator)])
                         -> IndexVec<CrateNum, Option<CrateNum>>
     {
index 25e72f462e680006634de0636a81e0e6e10b0181..510ca08b62100df4c0188a1b03c721b238397102 100644 (file)
@@ -733,7 +733,7 @@ pub fn name(&self) -> &'static str {
                 }
             }
 
-            pub fn describe(&self, tcx: TyCtxt) -> String {
+            pub fn describe(&self, tcx: TyCtxt<'_, '_, '_>) -> String {
                 let (r, name) = match *self {
                     $(Query::$name(key) => {
                         (queries::$name::describe(tcx, key), stringify!($name))
@@ -845,7 +845,7 @@ impl<'a, $tcx, 'lcx> queries::$name<$tcx> {
             ///
             /// Note: The optimization is only available during incr. comp.
             pub fn ensure(tcx: TyCtxt<'a, $tcx, 'lcx>, key: $K) -> () {
-                tcx.ensure_query::<queries::$name>(key);
+                tcx.ensure_query::<queries::$name<'_>>(key);
             }
         })*
 
@@ -881,7 +881,7 @@ pub fn $name(self, key: $K) -> $V {
         impl<'a, $tcx, 'lcx> TyCtxtAt<'a, $tcx, 'lcx> {
             $($(#[$attr])*
             pub fn $name(self, key: $K) -> $V {
-                self.tcx.get_query::<queries::$name>(self.span, key)
+                self.tcx.get_query::<queries::$name<'_>>(self.span, key)
             })*
         }
 
@@ -1028,7 +1028,9 @@ macro_rules! force {
                     )
                 );
 
-                match tcx.force_query::<::ty::query::queries::$query>($key, DUMMY_SP, *dep_node) {
+                match tcx.force_query::<::ty::query::queries::$query<'_>>(
+                    $key, DUMMY_SP, *dep_node
+                ) {
                     Ok(_) => {},
                     Err(e) => {
                         tcx.report_cycle(e).emit();
@@ -1281,7 +1283,7 @@ macro_rules! impl_load_from_cache {
         impl DepNode {
             // Check whether the query invocation corresponding to the given
             // DepNode is eligible for on-disk-caching.
-            pub fn cache_on_disk(&self, tcx: TyCtxt) -> bool {
+            pub fn cache_on_disk(&self, tcx: TyCtxt<'_, '_, '_>) -> bool {
                 use ty::query::queries;
                 use ty::query::QueryDescription;
 
@@ -1299,7 +1301,7 @@ pub fn cache_on_disk(&self, tcx: TyCtxt) -> bool {
             // above `cache_on_disk` methods returns true.
             // Also, as a sanity check, it expects that the corresponding query
             // invocation has been marked as green already.
-            pub fn load_from_on_disk_cache(&self, tcx: TyCtxt) {
+            pub fn load_from_on_disk_cache(&self, tcx: TyCtxt<'_, '_, '_>) {
                 match self.kind {
                     $(DepKind::$dep_kind => {
                         debug_assert!(tcx.dep_graph
index 3ff3cb4cae1d499dddf592c8a9db4854d0f00fcd..1092e23ec3b1d4b182fd9447a7ab7c4731e15f0d 100644 (file)
@@ -42,7 +42,7 @@ pub fn new(value: T) -> Self {
         }
     }
 
-    pub fn borrow(&self) -> MappedReadGuard<T> {
+    pub fn borrow(&self) -> MappedReadGuard<'_, T> {
         ReadGuard::map(self.value.borrow(), |opt| match *opt {
             None => bug!("attempted to read from stolen value"),
             Some(ref v) => v
index 8e4819b68a95f6e1d3e07d531fff2364af15a222..6c40dd892391671f8fd7770b83dd5db68c8a37e6 100644 (file)
@@ -708,7 +708,7 @@ pub fn erase_self_ty(tcx: TyCtxt<'a, 'gcx, 'tcx>,
     pub fn with_self_ty(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>, self_ty: Ty<'tcx>)
         -> ty::TraitRef<'tcx>  {
         // otherwise the escaping regions would be captured by the binder
-        debug_assert!(!self_ty.has_escaping_regions());
+        // debug_assert!(!self_ty.has_escaping_regions());
 
         ty::TraitRef {
             def_id: self.def_id,
@@ -864,7 +864,7 @@ impl<'a, 'tcx> ProjectionTy<'tcx> {
     /// Construct a ProjectionTy by searching the trait from trait_ref for the
     /// associated item named item_name.
     pub fn from_ref_and_name(
-        tcx: TyCtxt, trait_ref: ty::TraitRef<'tcx>, item_name: Ident
+        tcx: TyCtxt<'_, '_, '_>, trait_ref: ty::TraitRef<'tcx>, item_name: Ident
     ) -> ProjectionTy<'tcx> {
         let item_def_id = tcx.associated_items(trait_ref.def_id).find(|item| {
             item.kind == ty::AssociatedKind::Type &&
@@ -880,7 +880,7 @@ pub fn from_ref_and_name(
     /// Extracts the underlying trait reference from this projection.
     /// For example, if this is a projection of `<T as Iterator>::Item`,
     /// then this function would return a `T: Iterator` trait reference.
-    pub fn trait_ref(&self, tcx: TyCtxt) -> ty::TraitRef<'tcx> {
+    pub fn trait_ref(&self, tcx: TyCtxt<'_, '_, '_>) -> ty::TraitRef<'tcx> {
         let def_id = tcx.associated_item(self.item_def_id).container.id();
         ty::TraitRef {
             def_id,
@@ -1225,7 +1225,7 @@ impl<'a, 'tcx, 'gcx> ExistentialProjection<'tcx> {
     /// For example, if this is a projection of `exists T. <T as Iterator>::Item == X`,
     /// then this function would return a `exists T. T: Iterator` existential trait
     /// reference.
-    pub fn trait_ref(&self, tcx: TyCtxt) -> ty::ExistentialTraitRef<'tcx> {
+    pub fn trait_ref(&self, tcx: TyCtxt<'_, '_, '_>) -> ty::ExistentialTraitRef<'tcx> {
         let def_id = tcx.associated_item(self.item_def_id).container.id();
         ty::ExistentialTraitRef{
             def_id,
@@ -1569,7 +1569,7 @@ pub fn simd_type(&self, tcx: TyCtxt<'a, 'gcx, 'tcx>) -> Ty<'tcx> {
         }
     }
 
-    pub fn simd_size(&self, _cx: TyCtxt) -> usize {
+    pub fn simd_size(&self, _cx: TyCtxt<'_, '_, '_>) -> usize {
         match self.sty {
             Adt(def, _) => def.non_enum_variant().fields.len(),
             _ => bug!("simd_size called on invalid type")
index 696c4d0043c14993dd374c9c10fc943d339174cc..4b3a70e525ec3d11a9382e9b73fb717a56daf654 100644 (file)
@@ -73,13 +73,13 @@ fn pack(self) -> Kind<'tcx> {
 }
 
 impl<'tcx> Ord for Kind<'tcx> {
-    fn cmp(&self, other: &Kind) -> Ordering {
+    fn cmp(&self, other: &Kind<'_>) -> Ordering {
         self.unpack().cmp(&other.unpack())
     }
 }
 
 impl<'tcx> PartialOrd for Kind<'tcx> {
-    fn partial_cmp(&self, other: &Kind) -> Option<Ordering> {
+    fn partial_cmp(&self, other: &Kind<'_>) -> Option<Ordering> {
         Some(self.cmp(&other))
     }
 }
@@ -111,7 +111,7 @@ pub fn unpack(self) -> UnpackedKind<'tcx> {
 }
 
 impl<'tcx> fmt::Debug for Kind<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self.unpack() {
             UnpackedKind::Lifetime(lt) => write!(f, "{:?}", lt),
             UnpackedKind::Type(ty) => write!(f, "{:?}", ty),
@@ -120,7 +120,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Display for Kind<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self.unpack() {
             UnpackedKind::Lifetime(lt) => write!(f, "{}", lt),
             UnpackedKind::Type(ty) => write!(f, "{}", ty),
index cc0429de2f6241a644d97cf05b5f2f615bd44573..93fc77359e43ab082160b05a1ebe8675b1827412 100644 (file)
@@ -39,7 +39,7 @@ pub struct Discr<'tcx> {
 }
 
 impl<'tcx> fmt::Display for Discr<'tcx> {
-    fn fmt(&self, fmt: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, fmt: &mut fmt::Formatter<'_>) -> fmt::Result {
         match self.ty.sty {
             ty::Int(ity) => {
                 let bits = ty::tls::with(|tcx| {
@@ -846,7 +846,7 @@ fn is_type_structurally_recursive_inner<'a, 'tcx>(
         // To avoid a stack overflow when checking an enum variant or struct that
         // contains a different, structurally recursive type, maintain a stack
         // of seen types and check recursion for each of them (issues #3008, #3779).
-        let mut seen: Vec<Ty> = Vec::new();
+        let mut seen: Vec<Ty<'_>> = Vec::new();
         let mut representable_cache = FxHashMap();
         let r = is_type_structurally_recursive(
             tcx, sp, &mut seen, &mut representable_cache, self);
@@ -1039,7 +1039,7 @@ pub fn determine<P>(
     }
 }
 
-pub fn provide(providers: &mut ty::query::Providers) {
+pub fn provide(providers: &mut ty::query::Providers<'_>) {
     *providers = ty::query::Providers {
         is_copy_raw,
         is_sized_raw,
index f2593e4d4b5eeaa5aa0cf22b78cf6ba480f7840d..863b70c3df3f74dee5632c31ff4013c8e2abfe25 100644 (file)
@@ -16,7 +16,7 @@
 
 #[cold]
 #[inline(never)]
-pub fn bug_fmt(file: &'static str, line: u32, args: fmt::Arguments) -> ! {
+pub fn bug_fmt(file: &'static str, line: u32, args: fmt::Arguments<'_>) -> ! {
     // this wrapper mostly exists so I don't have to write a fully
     // qualified path of None::<Span> inside the bug!() macro definition
     opt_span_bug_fmt(file, line, None::<Span>, args);
@@ -28,7 +28,7 @@ pub fn span_bug_fmt<S: Into<MultiSpan>>(
     file: &'static str,
     line: u32,
     span: S,
-    args: fmt::Arguments,
+    args: fmt::Arguments<'_>,
 ) -> ! {
     opt_span_bug_fmt(file, line, Some(span), args);
 }
@@ -37,7 +37,7 @@ fn opt_span_bug_fmt<S: Into<MultiSpan>>(
     file: &'static str,
     line: u32,
     span: Option<S>,
-    args: fmt::Arguments,
+    args: fmt::Arguments<'_>,
 ) -> ! {
     tls::with_opt(move |tcx| {
         let msg = format!("{}:{}: {}", file, line, args);
index 02bdc5f41b35428e04287114043e94ce6ad0b5f5..bcc0b8047ef74f80f0a49272c8e0fcc71ea612a0 100644 (file)
 thread_local!(static TIME_DEPTH: Cell<usize> = Cell::new(0));
 
 lazy_static! {
-    static ref DEFAULT_HOOK: Box<dyn Fn(&panic::PanicInfo) + Sync + Send + 'static> = {
+    static ref DEFAULT_HOOK: Box<dyn Fn(&panic::PanicInfo<'_>) + Sync + Send + 'static> = {
         let hook = panic::take_hook();
         panic::set_hook(Box::new(panic_hook));
         hook
     };
 }
 
-fn panic_hook(info: &panic::PanicInfo) {
+fn panic_hook(info: &panic::PanicInfo<'_>) {
     if !proc_macro::__internal::in_sess() {
         (*DEFAULT_HOOK)(info);
 
index 59dd90dbd329a8e8cb5277fde0123216d4f0c281..10382008e0d43a692e07501268bc91ba3017a3be 100644 (file)
@@ -46,7 +46,7 @@
 
 macro_rules! gen_display_debug_body {
     ( $with:path ) => {
-        fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+        fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
             let mut cx = PrintContext::new();
             $with(self, f, &mut cx)
         }
@@ -225,9 +225,9 @@ fn print_debug_to_string(&self, cx: &mut PrintContext) -> String {
 impl PrintContext {
     fn fn_sig<F: fmt::Write>(&mut self,
                              f: &mut F,
-                             inputs: &[Ty],
+                             inputs: &[Ty<'_>],
                              variadic: bool,
-                             output: Ty)
+                             output: Ty<'_>)
                              -> fmt::Result {
         write!(f, "(")?;
         let mut inputs = inputs.iter();
@@ -250,9 +250,9 @@ fn fn_sig<F: fmt::Write>(&mut self,
 
     fn parameterized<F: fmt::Write>(&mut self,
                                     f: &mut F,
-                                    substs: &subst::Substs,
+                                    substs: &subst::Substs<'_>,
                                     mut did: DefId,
-                                    projections: &[ty::ProjectionPredicate])
+                                    projections: &[ty::ProjectionPredicate<'_>])
                                     -> fmt::Result {
         let key = ty::tls::with(|tcx| tcx.def_key(did));
         let mut item_name = if let Some(name) = key.disambiguated_data.data.get_opt_name() {
@@ -395,12 +395,12 @@ fn parameterized<F: fmt::Write>(&mut self,
         let print_regions = |f: &mut F, start: &str, skip, count| {
             // Don't print any regions if they're all erased.
             let regions = || substs.regions().skip(skip).take(count);
-            if regions().all(|r: ty::Region| *r == ty::ReErased) {
+            if regions().all(|r: ty::Region<'_>| *r == ty::ReErased) {
                 return Ok(());
             }
 
             for region in regions() {
-                let region: ty::Region = region;
+                let region: ty::Region<'_> = region;
                 start_or_continue(f, start, ", ")?;
                 if verbose {
                     write!(f, "{:?}", region)?;
@@ -564,9 +564,9 @@ pub fn identify_regions() -> bool {
 }
 
 pub fn parameterized<F: fmt::Write>(f: &mut F,
-                                    substs: &subst::Substs,
+                                    substs: &subst::Substs<'_>,
                                     did: DefId,
-                                    projections: &[ty::ProjectionPredicate])
+                                    projections: &[ty::ProjectionPredicate<'_>])
                                     -> fmt::Result {
     PrintContext::new().parameterized(f, substs, did, projections)
 }
@@ -646,7 +646,7 @@ fn print<F: fmt::Write>(&self, f: &mut F, cx: &mut PrintContext) -> fmt::Result
 }
 
 impl fmt::Debug for ty::GenericParamDef {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         let type_name = match self.kind {
             ty::GenericParamDefKind::Lifetime => "Lifetime",
             ty::GenericParamDefKind::Type {..} => "Type",
@@ -660,7 +660,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for ty::TraitDef {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         ty::tls::with(|tcx| {
             write!(f, "{}", tcx.item_path_str(self.def_id))
         })
@@ -668,7 +668,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for ty::AdtDef {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         ty::tls::with(|tcx| {
             write!(f, "{}", tcx.item_path_str(self.did))
         })
@@ -676,7 +676,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Debug for ty::ClosureUpvar<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "ClosureUpvar({:?},{:?})",
                self.def,
                self.ty)
@@ -684,7 +684,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for ty::UpvarId {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "UpvarId({:?};`{}`;{:?})",
                self.var_id,
                ty::tls::with(|tcx| tcx.hir.name(tcx.hir.hir_to_node_id(self.var_id))),
@@ -693,7 +693,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl<'tcx> fmt::Debug for ty::UpvarBorrow<'tcx> {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "UpvarBorrow({:?}, {:?})",
                self.kind, self.region)
     }
@@ -942,25 +942,25 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for ty::TyVid {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "_#{}t", self.index)
     }
 }
 
 impl fmt::Debug for ty::IntVid {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "_#{}i", self.index)
     }
 }
 
 impl fmt::Debug for ty::FloatVid {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         write!(f, "_#{}f", self.index)
     }
 }
 
 impl fmt::Debug for ty::RegionVid {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         if let Some((region, counter)) = get_highlight_region_for_regionvid() {
             debug!("RegionVid.fmt: region={:?} self={:?} counter={:?}", region, self, counter);
             return if *self == region {
@@ -1006,7 +1006,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for ty::IntVarValue {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         match *self {
             ty::IntType(ref v) => v.fmt(f),
             ty::UintType(ref v) => v.fmt(f),
@@ -1015,7 +1015,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
 }
 
 impl fmt::Debug for ty::FloatVarValue {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         self.0.fmt(f)
     }
 }
@@ -1026,7 +1026,7 @@ fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
     where T: fmt::Display + for<'a> ty::Lift<'a>,
           for<'a> <T as ty::Lift<'a>>::Lifted: fmt::Display + TypeFoldable<'a>
 {
-    fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
+    fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
         ty::tls::with(|tcx| in_binder(f, tcx, self, tcx.lift(self)))
     }
 }*/
index 70760d35f7865c1f3e78d8b208f6990d37cb59d7..37073b6e82080a616db922205dc26b990e4d5310 100644 (file)
@@ -61,7 +61,7 @@ fn new() -> CategoryData {
                 }
             }
 
-            fn print(&self, lock: &mut StdoutLock) {
+            fn print(&self, lock: &mut StdoutLock<'_>) {
                 writeln!(lock, "| Phase            | Time (ms)      | Queries        | Hits (%) |")
                     .unwrap();
                 writeln!(lock, "| ---------------- | -------------- | -------------- | -------- |")