@@ -191,7 +191,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
191191 span,
192192 def_id,
193193 generic_args,
194- item_segment. infer_types ,
194+ item_segment. infer_args ,
195195 None ,
196196 )
197197 } ) ;
@@ -208,7 +208,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
208208 seg : & hir:: PathSegment ,
209209 generics : & ty:: Generics ,
210210 ) -> bool {
211- let explicit = !seg. infer_types ;
211+ let explicit = !seg. infer_args ;
212212 let impl_trait = generics. params . iter ( ) . any ( |param| match param. kind {
213213 ty:: GenericParamDefKind :: Type {
214214 synthetic : Some ( hir:: SyntheticTyParamKind :: ImplTrait ) , ..
@@ -259,7 +259,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
259259 GenericArgPosition :: Value
260260 } ,
261261 def. parent . is_none ( ) && def. has_self , // `has_self`
262- seg. infer_types || suppress_mismatch, // `infer_types `
262+ seg. infer_args || suppress_mismatch, // `infer_args `
263263 ) . 0
264264 }
265265
@@ -272,7 +272,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
272272 args : & hir:: GenericArgs ,
273273 position : GenericArgPosition ,
274274 has_self : bool ,
275- infer_types : bool ,
275+ infer_args : bool ,
276276 ) -> ( bool , Option < Vec < Span > > ) {
277277 // At this stage we are guaranteed that the generic arguments are in the correct order, e.g.
278278 // that lifetimes will proceed types. So it suffices to check the number of each generic
@@ -414,7 +414,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
414414 ) ;
415415 }
416416 // Note that type errors are currently be emitted *after* const errors.
417- if !infer_types
417+ if !infer_args
418418 || arg_counts. types > param_counts. types - defaults. types - has_self as usize {
419419 check_kind_count (
420420 "type" ,
@@ -511,7 +511,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
511511 }
512512
513513 // Check whether this segment takes generic arguments and the user has provided any.
514- let ( generic_args, infer_types ) = args_for_def_id ( def_id) ;
514+ let ( generic_args, infer_args ) = args_for_def_id ( def_id) ;
515515
516516 let mut args = generic_args. iter ( ) . flat_map ( |generic_args| generic_args. args . iter ( ) )
517517 . peekable ( ) ;
@@ -535,7 +535,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
535535 | ( GenericArg :: Const ( _) , GenericParamDefKind :: Lifetime ) => {
536536 // We expected a lifetime argument, but got a type or const
537537 // argument. That means we're inferring the lifetimes.
538- substs. push ( inferred_kind ( None , param, infer_types ) ) ;
538+ substs. push ( inferred_kind ( None , param, infer_args ) ) ;
539539 params. next ( ) ;
540540 }
541541 ( _, _) => {
@@ -556,7 +556,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
556556 ( None , Some ( & param) ) => {
557557 // If there are fewer arguments than parameters, it means
558558 // we're inferring the remaining arguments.
559- substs. push ( inferred_kind ( Some ( & substs) , param, infer_types ) ) ;
559+ substs. push ( inferred_kind ( Some ( & substs) , param, infer_args ) ) ;
560560 args. next ( ) ;
561561 params. next ( ) ;
562562 }
@@ -592,7 +592,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
592592 span : Span ,
593593 def_id : DefId ,
594594 generic_args : & ' a hir:: GenericArgs ,
595- infer_types : bool ,
595+ infer_args : bool ,
596596 self_ty : Option < Ty < ' tcx > > )
597597 -> ( SubstsRef < ' tcx > , Vec < ConvertedBinding < ' tcx > > , Option < Vec < Span > > )
598598 {
@@ -617,7 +617,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
617617 & generic_args,
618618 GenericArgPosition :: Type ,
619619 has_self,
620- infer_types ,
620+ infer_args ,
621621 ) ;
622622
623623 let is_object = self_ty. map_or ( false , |ty| {
@@ -644,7 +644,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
644644 self_ty. is_some ( ) ,
645645 self_ty,
646646 // Provide the generic args, and whether types should be inferred.
647- |_| ( Some ( generic_args) , infer_types ) ,
647+ |_| ( Some ( generic_args) , infer_args ) ,
648648 // Provide substitutions for parameters for which (valid) arguments have been provided.
649649 |param, arg| {
650650 match ( & param. kind , arg) {
@@ -661,11 +661,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
661661 }
662662 } ,
663663 // Provide substitutions for parameters for which arguments are inferred.
664- |substs, param, infer_types | {
664+ |substs, param, infer_args | {
665665 match param. kind {
666666 GenericParamDefKind :: Lifetime => tcx. lifetimes . re_static . into ( ) ,
667667 GenericParamDefKind :: Type { has_default, .. } => {
668- if !infer_types && has_default {
668+ if !infer_args && has_default {
669669 // No type parameter provided, but a default exists.
670670
671671 // If we are converting an object type, then the
@@ -693,7 +693,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
693693 . subst_spanned ( tcx, substs. unwrap ( ) , Some ( span) )
694694 ) . into ( )
695695 }
696- } else if infer_types {
696+ } else if infer_args {
697697 // No type parameters were provided, we can infer all.
698698 if !default_needs_object_self ( param) {
699699 self . ty_infer_for_def ( param, span) . into ( )
@@ -880,7 +880,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
880880 self . create_substs_for_ast_path ( span,
881881 trait_def_id,
882882 generic_args,
883- trait_segment. infer_types ,
883+ trait_segment. infer_args ,
884884 Some ( self_ty) )
885885 } )
886886 }
0 commit comments