@@ -191,7 +191,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
191
191
span,
192
192
def_id,
193
193
generic_args,
194
- item_segment. infer_types ,
194
+ item_segment. infer_args ,
195
195
None ,
196
196
)
197
197
} ) ;
@@ -208,7 +208,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
208
208
seg : & hir:: PathSegment ,
209
209
generics : & ty:: Generics ,
210
210
) -> bool {
211
- let explicit = !seg. infer_types ;
211
+ let explicit = !seg. infer_args ;
212
212
let impl_trait = generics. params . iter ( ) . any ( |param| match param. kind {
213
213
ty:: GenericParamDefKind :: Type {
214
214
synthetic : Some ( hir:: SyntheticTyParamKind :: ImplTrait ) , ..
@@ -259,7 +259,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
259
259
GenericArgPosition :: Value
260
260
} ,
261
261
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 `
263
263
) . 0
264
264
}
265
265
@@ -272,7 +272,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
272
272
args : & hir:: GenericArgs ,
273
273
position : GenericArgPosition ,
274
274
has_self : bool ,
275
- infer_types : bool ,
275
+ infer_args : bool ,
276
276
) -> ( bool , Option < Vec < Span > > ) {
277
277
// At this stage we are guaranteed that the generic arguments are in the correct order, e.g.
278
278
// 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 {
414
414
) ;
415
415
}
416
416
// Note that type errors are currently be emitted *after* const errors.
417
- if !infer_types
417
+ if !infer_args
418
418
|| arg_counts. types > param_counts. types - defaults. types - has_self as usize {
419
419
check_kind_count (
420
420
"type" ,
@@ -511,7 +511,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
511
511
}
512
512
513
513
// 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) ;
515
515
516
516
let mut args = generic_args. iter ( ) . flat_map ( |generic_args| generic_args. args . iter ( ) )
517
517
. peekable ( ) ;
@@ -535,7 +535,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
535
535
| ( GenericArg :: Const ( _) , GenericParamDefKind :: Lifetime ) => {
536
536
// We expected a lifetime argument, but got a type or const
537
537
// 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 ) ) ;
539
539
params. next ( ) ;
540
540
}
541
541
( _, _) => {
@@ -556,7 +556,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
556
556
( None , Some ( & param) ) => {
557
557
// If there are fewer arguments than parameters, it means
558
558
// 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 ) ) ;
560
560
args. next ( ) ;
561
561
params. next ( ) ;
562
562
}
@@ -592,7 +592,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
592
592
span : Span ,
593
593
def_id : DefId ,
594
594
generic_args : & ' a hir:: GenericArgs ,
595
- infer_types : bool ,
595
+ infer_args : bool ,
596
596
self_ty : Option < Ty < ' tcx > > )
597
597
-> ( SubstsRef < ' tcx > , Vec < ConvertedBinding < ' tcx > > , Option < Vec < Span > > )
598
598
{
@@ -617,7 +617,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
617
617
& generic_args,
618
618
GenericArgPosition :: Type ,
619
619
has_self,
620
- infer_types ,
620
+ infer_args ,
621
621
) ;
622
622
623
623
let is_object = self_ty. map_or ( false , |ty| {
@@ -644,7 +644,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
644
644
self_ty. is_some ( ) ,
645
645
self_ty,
646
646
// Provide the generic args, and whether types should be inferred.
647
- |_| ( Some ( generic_args) , infer_types ) ,
647
+ |_| ( Some ( generic_args) , infer_args ) ,
648
648
// Provide substitutions for parameters for which (valid) arguments have been provided.
649
649
|param, arg| {
650
650
match ( & param. kind , arg) {
@@ -661,11 +661,11 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
661
661
}
662
662
} ,
663
663
// Provide substitutions for parameters for which arguments are inferred.
664
- |substs, param, infer_types | {
664
+ |substs, param, infer_args | {
665
665
match param. kind {
666
666
GenericParamDefKind :: Lifetime => tcx. lifetimes . re_static . into ( ) ,
667
667
GenericParamDefKind :: Type { has_default, .. } => {
668
- if !infer_types && has_default {
668
+ if !infer_args && has_default {
669
669
// No type parameter provided, but a default exists.
670
670
671
671
// If we are converting an object type, then the
@@ -693,7 +693,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
693
693
. subst_spanned ( tcx, substs. unwrap ( ) , Some ( span) )
694
694
) . into ( )
695
695
}
696
- } else if infer_types {
696
+ } else if infer_args {
697
697
// No type parameters were provided, we can infer all.
698
698
if !default_needs_object_self ( param) {
699
699
self . ty_infer_for_def ( param, span) . into ( )
@@ -880,7 +880,7 @@ impl<'o, 'gcx: 'tcx, 'tcx> dyn AstConv<'gcx, 'tcx> + 'o {
880
880
self . create_substs_for_ast_path ( span,
881
881
trait_def_id,
882
882
generic_args,
883
- trait_segment. infer_types ,
883
+ trait_segment. infer_args ,
884
884
Some ( self_ty) )
885
885
} )
886
886
}
0 commit comments