11use crate :: tls;
22use chalk_ir:: interner:: { HasInterner , Interner } ;
33use chalk_ir:: {
4- AliasTy , ApplicationTy , AssocTypeId , CanonicalVarKinds , Goals , Lifetime , OpaqueTy , OpaqueTyId ,
5- ParameterKinds , ProgramClauseImplication , ProgramClauses , ProjectionTy , QuantifiedWhereClauses ,
6- SeparatorTraitRef , Substitution , TraitId , Ty ,
4+ AliasTy , ApplicationTy , AssocTypeId , CanonicalVarKind , CanonicalVarKinds , Goals , Lifetime ,
5+ OpaqueTy , OpaqueTyId , ProgramClauseImplication , ProgramClauses , ProjectionTy ,
6+ QuantifiedWhereClauses , SeparatorTraitRef , Substitution , TraitId , Ty , VariableKind ,
7+ VariableKinds ,
78} ;
89use chalk_ir:: {
9- Goal , GoalData , LifetimeData , Parameter , ParameterData , ParameterKind , ProgramClause ,
10- ProgramClauseData , QuantifiedWhereClause , StructId , TyData , UniverseIndex ,
10+ GenericArg , GenericArgData , Goal , GoalData , LifetimeData , ProgramClause , ProgramClauseData ,
11+ QuantifiedWhereClause , StructId , TyData ,
1112} ;
1213use std:: fmt;
1314use std:: fmt:: Debug ;
@@ -35,15 +36,15 @@ pub struct ChalkIr;
3536impl Interner for ChalkIr {
3637 type InternedType = Arc < TyData < ChalkIr > > ;
3738 type InternedLifetime = LifetimeData < ChalkIr > ;
38- type InternedParameter = ParameterData < ChalkIr > ;
39+ type InternedGenericArg = GenericArgData < ChalkIr > ;
3940 type InternedGoal = Arc < GoalData < ChalkIr > > ;
4041 type InternedGoals = Vec < Goal < ChalkIr > > ;
41- type InternedSubstitution = Vec < Parameter < ChalkIr > > ;
42+ type InternedSubstitution = Vec < GenericArg < ChalkIr > > ;
4243 type InternedProgramClause = ProgramClauseData < ChalkIr > ;
4344 type InternedProgramClauses = Vec < ProgramClause < ChalkIr > > ;
4445 type InternedQuantifiedWhereClauses = Vec < QuantifiedWhereClause < ChalkIr > > ;
45- type InternedParameterKinds = Vec < ParameterKind < ( ) > > ;
46- type InternedCanonicalVarKinds = Vec < ParameterKind < UniverseIndex > > ;
46+ type InternedVariableKinds = Vec < VariableKind < ChalkIr > > ;
47+ type InternedCanonicalVarKinds = Vec < CanonicalVarKind < ChalkIr > > ;
4748 type DefId = RawId ;
4849 type Identifier = Identifier ;
4950
@@ -105,26 +106,26 @@ impl Interner for ChalkIr {
105106 . or_else ( || Some ( write ! ( fmt, "{:?}" , lifetime. interned( ) ) ) )
106107 }
107108
108- fn debug_parameter (
109- parameter : & Parameter < ChalkIr > ,
109+ fn debug_generic_arg (
110+ generic_arg : & GenericArg < ChalkIr > ,
110111 fmt : & mut fmt:: Formatter < ' _ > ,
111112 ) -> Option < fmt:: Result > {
112- tls:: with_current_program ( |prog| Some ( prog?. debug_parameter ( parameter , fmt) ) )
113+ tls:: with_current_program ( |prog| Some ( prog?. debug_generic_arg ( generic_arg , fmt) ) )
113114 }
114115
115- fn debug_parameter_kinds (
116- parameter_kinds : & ParameterKinds < Self > ,
116+ fn debug_variable_kinds (
117+ variable_kinds : & VariableKinds < Self > ,
117118 fmt : & mut fmt:: Formatter < ' _ > ,
118119 ) -> Option < fmt:: Result > {
119- tls:: with_current_program ( |prog| Some ( prog?. debug_parameter_kinds ( parameter_kinds , fmt) ) )
120+ tls:: with_current_program ( |prog| Some ( prog?. debug_variable_kinds ( variable_kinds , fmt) ) )
120121 }
121122
122- fn debug_parameter_kinds_with_angles (
123- parameter_kinds : & ParameterKinds < Self > ,
123+ fn debug_variable_kinds_with_angles (
124+ variable_kinds : & VariableKinds < Self > ,
124125 fmt : & mut fmt:: Formatter < ' _ > ,
125126 ) -> Option < fmt:: Result > {
126127 tls:: with_current_program ( |prog| {
127- Some ( prog?. debug_parameter_kinds_with_angles ( parameter_kinds , fmt) )
128+ Some ( prog?. debug_variable_kinds_with_angles ( variable_kinds , fmt) )
128129 } )
129130 }
130131
@@ -212,15 +213,15 @@ impl Interner for ChalkIr {
212213 lifetime
213214 }
214215
215- fn intern_parameter ( & self , parameter : ParameterData < ChalkIr > ) -> ParameterData < ChalkIr > {
216- parameter
216+ fn intern_generic_arg ( & self , generic_arg : GenericArgData < ChalkIr > ) -> GenericArgData < ChalkIr > {
217+ generic_arg
217218 }
218219
219- fn parameter_data < ' a > (
220+ fn generic_arg_data < ' a > (
220221 & self ,
221- parameter : & ' a ParameterData < ChalkIr > ,
222- ) -> & ' a ParameterData < ChalkIr > {
223- parameter
222+ generic_arg : & ' a GenericArgData < ChalkIr > ,
223+ ) -> & ' a GenericArgData < ChalkIr > {
224+ generic_arg
224225 }
225226
226227 fn intern_goal ( & self , goal : GoalData < ChalkIr > ) -> Arc < GoalData < ChalkIr > > {
@@ -244,15 +245,15 @@ impl Interner for ChalkIr {
244245
245246 fn intern_substitution < E > (
246247 & self ,
247- data : impl IntoIterator < Item = Result < Parameter < ChalkIr > , E > > ,
248- ) -> Result < Vec < Parameter < ChalkIr > > , E > {
248+ data : impl IntoIterator < Item = Result < GenericArg < ChalkIr > , E > > ,
249+ ) -> Result < Vec < GenericArg < ChalkIr > > , E > {
249250 data. into_iter ( ) . collect ( )
250251 }
251252
252253 fn substitution_data < ' a > (
253254 & self ,
254- substitution : & ' a Vec < Parameter < ChalkIr > > ,
255- ) -> & ' a [ Parameter < ChalkIr > ] {
255+ substitution : & ' a Vec < GenericArg < ChalkIr > > ,
256+ ) -> & ' a [ GenericArg < ChalkIr > ] {
256257 substitution
257258 }
258259
@@ -294,31 +295,31 @@ impl Interner for ChalkIr {
294295 ) -> & ' a [ QuantifiedWhereClause < Self > ] {
295296 clauses
296297 }
297- fn intern_parameter_kinds < E > (
298+ fn intern_generic_arg_kinds < E > (
298299 & self ,
299- data : impl IntoIterator < Item = Result < ParameterKind < ( ) > , E > > ,
300- ) -> Result < Self :: InternedParameterKinds , E > {
300+ data : impl IntoIterator < Item = Result < VariableKind < ChalkIr > , E > > ,
301+ ) -> Result < Self :: InternedVariableKinds , E > {
301302 data. into_iter ( ) . collect ( )
302303 }
303304
304- fn parameter_kinds_data < ' a > (
305+ fn variable_kinds_data < ' a > (
305306 & self ,
306- parameter_kinds : & ' a Self :: InternedParameterKinds ,
307- ) -> & ' a [ ParameterKind < ( ) > ] {
308- parameter_kinds
307+ variable_kinds : & ' a Self :: InternedVariableKinds ,
308+ ) -> & ' a [ VariableKind < ChalkIr > ] {
309+ variable_kinds
309310 }
310311
311312 fn intern_canonical_var_kinds < E > (
312313 & self ,
313- data : impl IntoIterator < Item = Result < ParameterKind < UniverseIndex > , E > > ,
314+ data : impl IntoIterator < Item = Result < CanonicalVarKind < ChalkIr > , E > > ,
314315 ) -> Result < Self :: InternedCanonicalVarKinds , E > {
315316 data. into_iter ( ) . collect ( )
316317 }
317318
318319 fn canonical_var_kinds_data < ' a > (
319320 & self ,
320321 canonical_var_kinds : & ' a Self :: InternedCanonicalVarKinds ,
321- ) -> & ' a [ ParameterKind < UniverseIndex > ] {
322+ ) -> & ' a [ CanonicalVarKind < ChalkIr > ] {
322323 canonical_var_kinds
323324 }
324325}
0 commit comments