1
1
use crate :: tls;
2
2
use chalk_ir:: interner:: { HasInterner , Interner } ;
3
3
use 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 ,
7
8
} ;
8
9
use 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 ,
11
12
} ;
12
13
use std:: fmt;
13
14
use std:: fmt:: Debug ;
@@ -35,15 +36,15 @@ pub struct ChalkIr;
35
36
impl Interner for ChalkIr {
36
37
type InternedType = Arc < TyData < ChalkIr > > ;
37
38
type InternedLifetime = LifetimeData < ChalkIr > ;
38
- type InternedParameter = ParameterData < ChalkIr > ;
39
+ type InternedGenericArg = GenericArgData < ChalkIr > ;
39
40
type InternedGoal = Arc < GoalData < ChalkIr > > ;
40
41
type InternedGoals = Vec < Goal < ChalkIr > > ;
41
- type InternedSubstitution = Vec < Parameter < ChalkIr > > ;
42
+ type InternedSubstitution = Vec < GenericArg < ChalkIr > > ;
42
43
type InternedProgramClause = ProgramClauseData < ChalkIr > ;
43
44
type InternedProgramClauses = Vec < ProgramClause < ChalkIr > > ;
44
45
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 > > ;
47
48
type DefId = RawId ;
48
49
type Identifier = Identifier ;
49
50
@@ -105,26 +106,26 @@ impl Interner for ChalkIr {
105
106
. or_else ( || Some ( write ! ( fmt, "{:?}" , lifetime. interned( ) ) ) )
106
107
}
107
108
108
- fn debug_parameter (
109
- parameter : & Parameter < ChalkIr > ,
109
+ fn debug_generic_arg (
110
+ generic_arg : & GenericArg < ChalkIr > ,
110
111
fmt : & mut fmt:: Formatter < ' _ > ,
111
112
) -> 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) ) )
113
114
}
114
115
115
- fn debug_parameter_kinds (
116
- parameter_kinds : & ParameterKinds < Self > ,
116
+ fn debug_variable_kinds (
117
+ variable_kinds : & VariableKinds < Self > ,
117
118
fmt : & mut fmt:: Formatter < ' _ > ,
118
119
) -> 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) ) )
120
121
}
121
122
122
- fn debug_parameter_kinds_with_angles (
123
- parameter_kinds : & ParameterKinds < Self > ,
123
+ fn debug_variable_kinds_with_angles (
124
+ variable_kinds : & VariableKinds < Self > ,
124
125
fmt : & mut fmt:: Formatter < ' _ > ,
125
126
) -> Option < fmt:: Result > {
126
127
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) )
128
129
} )
129
130
}
130
131
@@ -212,15 +213,15 @@ impl Interner for ChalkIr {
212
213
lifetime
213
214
}
214
215
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
217
218
}
218
219
219
- fn parameter_data < ' a > (
220
+ fn generic_arg_data < ' a > (
220
221
& 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
224
225
}
225
226
226
227
fn intern_goal ( & self , goal : GoalData < ChalkIr > ) -> Arc < GoalData < ChalkIr > > {
@@ -244,15 +245,15 @@ impl Interner for ChalkIr {
244
245
245
246
fn intern_substitution < E > (
246
247
& 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 > {
249
250
data. into_iter ( ) . collect ( )
250
251
}
251
252
252
253
fn substitution_data < ' a > (
253
254
& self ,
254
- substitution : & ' a Vec < Parameter < ChalkIr > > ,
255
- ) -> & ' a [ Parameter < ChalkIr > ] {
255
+ substitution : & ' a Vec < GenericArg < ChalkIr > > ,
256
+ ) -> & ' a [ GenericArg < ChalkIr > ] {
256
257
substitution
257
258
}
258
259
@@ -294,31 +295,31 @@ impl Interner for ChalkIr {
294
295
) -> & ' a [ QuantifiedWhereClause < Self > ] {
295
296
clauses
296
297
}
297
- fn intern_parameter_kinds < E > (
298
+ fn intern_generic_arg_kinds < E > (
298
299
& 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 > {
301
302
data. into_iter ( ) . collect ( )
302
303
}
303
304
304
- fn parameter_kinds_data < ' a > (
305
+ fn variable_kinds_data < ' a > (
305
306
& 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
309
310
}
310
311
311
312
fn intern_canonical_var_kinds < E > (
312
313
& self ,
313
- data : impl IntoIterator < Item = Result < ParameterKind < UniverseIndex > , E > > ,
314
+ data : impl IntoIterator < Item = Result < CanonicalVarKind < ChalkIr > , E > > ,
314
315
) -> Result < Self :: InternedCanonicalVarKinds , E > {
315
316
data. into_iter ( ) . collect ( )
316
317
}
317
318
318
319
fn canonical_var_kinds_data < ' a > (
319
320
& self ,
320
321
canonical_var_kinds : & ' a Self :: InternedCanonicalVarKinds ,
321
- ) -> & ' a [ ParameterKind < UniverseIndex > ] {
322
+ ) -> & ' a [ CanonicalVarKind < ChalkIr > ] {
322
323
canonical_var_kinds
323
324
}
324
325
}
0 commit comments