@@ -16,12 +16,12 @@ use triomphe::Arc;
1616
1717use super :: { InferOk , InferResult , InferenceContext , TypeError } ;
1818use crate :: {
19- consteval:: unknown_const, db:: HirDatabase , fold_tys_and_consts , static_lifetime ,
20- to_chalk_trait_id, traits:: FnTrait , AliasEq , AliasTy , BoundVar , Canonical , Const , ConstValue ,
21- DebruijnIndex , DomainGoal , GenericArg , GenericArgData , Goal , GoalData , Guidance , InEnvironment ,
22- InferenceVar , Interner , Lifetime , OpaqueTyId , ParamKind , ProjectionTy , ProjectionTyExt , Scalar ,
23- Solution , Substitution , TraitEnvironment , Ty , TyBuilder , TyExt , TyKind , VariableKind ,
24- WhereClause ,
19+ consteval:: unknown_const, db:: HirDatabase , fold_generic_args , fold_tys_and_consts ,
20+ static_lifetime , to_chalk_trait_id, traits:: FnTrait , AliasEq , AliasTy , BoundVar , Canonical ,
21+ Const , ConstValue , DebruijnIndex , DomainGoal , GenericArg , GenericArgData , Goal , GoalData ,
22+ Guidance , InEnvironment , InferenceVar , Interner , Lifetime , OpaqueTyId , ParamKind , ProjectionTy ,
23+ ProjectionTyExt , Scalar , Solution , Substitution , TraitEnvironment , Ty , TyBuilder , TyExt ,
24+ TyKind , VariableKind , WhereClause ,
2525} ;
2626
2727impl InferenceContext < ' _ > {
@@ -862,11 +862,16 @@ impl<'a> InferenceTable<'a> {
862862 where
863863 T : HasInterner < Interner = Interner > + TypeFoldable < Interner > ,
864864 {
865- fold_tys_and_consts (
865+ fold_generic_args (
866866 ty,
867- |it, _| match it {
868- Either :: Left ( ty) => Either :: Left ( self . insert_type_vars_shallow ( ty) ) ,
869- Either :: Right ( c) => Either :: Right ( self . insert_const_vars_shallow ( c) ) ,
867+ |arg, _| match arg {
868+ GenericArgData :: Ty ( ty) => GenericArgData :: Ty ( self . insert_type_vars_shallow ( ty) ) ,
869+ // FIXME: insert lifetime vars once LifetimeData::InferenceVar
870+ // and specific error variant for lifetimes start being constructed
871+ GenericArgData :: Lifetime ( lt) => GenericArgData :: Lifetime ( lt) ,
872+ GenericArgData :: Const ( c) => {
873+ GenericArgData :: Const ( self . insert_const_vars_shallow ( c) )
874+ }
870875 } ,
871876 DebruijnIndex :: INNERMOST ,
872877 )
0 commit comments