@@ -16,12 +16,12 @@ use triomphe::Arc;
16
16
17
17
use super :: { InferOk , InferResult , InferenceContext , TypeError } ;
18
18
use 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 ,
25
25
} ;
26
26
27
27
impl InferenceContext < ' _ > {
@@ -862,11 +862,16 @@ impl<'a> InferenceTable<'a> {
862
862
where
863
863
T : HasInterner < Interner = Interner > + TypeFoldable < Interner > ,
864
864
{
865
- fold_tys_and_consts (
865
+ fold_generic_args (
866
866
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
+ }
870
875
} ,
871
876
DebruijnIndex :: INNERMOST ,
872
877
)
0 commit comments