|
1 | 1 | use crate::tls;
|
2 | 2 | use chalk_ir::interner::{HasInterner, Interner};
|
3 | 3 | use chalk_ir::{
|
4 |
| - AliasTy, ApplicationTy, AssocTypeId, CanonicalVarKind, CanonicalVarKinds, Goals, Lifetime, |
5 |
| - OpaqueTy, OpaqueTyId, ProgramClauseImplication, ProgramClauses, ProjectionTy, |
| 4 | + AliasTy, ApplicationTy, AssocTypeId, CanonicalVarKind, CanonicalVarKinds, ConstData, Goals, |
| 5 | + Lifetime, OpaqueTy, OpaqueTyId, ProgramClauseImplication, ProgramClauses, ProjectionTy, |
6 | 6 | QuantifiedWhereClauses, SeparatorTraitRef, Substitution, TraitId, Ty, VariableKind,
|
7 | 7 | VariableKinds,
|
8 | 8 | };
|
@@ -36,6 +36,8 @@ pub struct ChalkIr;
|
36 | 36 | impl Interner for ChalkIr {
|
37 | 37 | type InternedType = Arc<TyData<ChalkIr>>;
|
38 | 38 | type InternedLifetime = LifetimeData<ChalkIr>;
|
| 39 | + type InternedConst = Arc<ConstData<ChalkIr>>; |
| 40 | + type InternedConcreteConst = u32; |
39 | 41 | type InternedGenericArg = GenericArgData<ChalkIr>;
|
40 | 42 | type InternedGoal = Arc<GoalData<ChalkIr>>;
|
41 | 43 | type InternedGoals = Vec<Goal<ChalkIr>>;
|
@@ -213,6 +215,18 @@ impl Interner for ChalkIr {
|
213 | 215 | lifetime
|
214 | 216 | }
|
215 | 217 |
|
| 218 | + fn intern_const(&self, constant: ConstData<ChalkIr>) -> Arc<ConstData<ChalkIr>> { |
| 219 | + Arc::new(constant) |
| 220 | + } |
| 221 | + |
| 222 | + fn const_data<'a>(&self, constant: &'a Arc<ConstData<ChalkIr>>) -> &'a ConstData<ChalkIr> { |
| 223 | + constant |
| 224 | + } |
| 225 | + |
| 226 | + fn const_eq(&self, _ty: &Arc<TyData<ChalkIr>>, c1: &u32, c2: &u32) -> bool { |
| 227 | + c1 == c2 |
| 228 | + } |
| 229 | + |
216 | 230 | fn intern_generic_arg(&self, generic_arg: GenericArgData<ChalkIr>) -> GenericArgData<ChalkIr> {
|
217 | 231 | generic_arg
|
218 | 232 | }
|
|
0 commit comments