|
1 | 1 | use crate::tls; |
2 | 2 | use chalk_ir::interner::{HasInterner, Interner}; |
3 | 3 | use chalk_ir::{ |
4 | | - AdtId, AliasTy, ApplicationTy, AssocTypeId, CanonicalVarKind, CanonicalVarKinds, Goals, |
5 | | - Lifetime, OpaqueTy, OpaqueTyId, ProgramClauseImplication, ProgramClauses, ProjectionTy, |
| 4 | + AdtId, AliasTy, ApplicationTy, AssocTypeId, CanonicalVarKind, CanonicalVarKinds, ConstData, |
| 5 | + Goals, 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>>; |
@@ -214,6 +216,18 @@ impl Interner for ChalkIr { |
214 | 216 | lifetime |
215 | 217 | } |
216 | 218 |
|
| 219 | + fn intern_const(&self, constant: ConstData<ChalkIr>) -> Arc<ConstData<ChalkIr>> { |
| 220 | + Arc::new(constant) |
| 221 | + } |
| 222 | + |
| 223 | + fn const_data<'a>(&self, constant: &'a Arc<ConstData<ChalkIr>>) -> &'a ConstData<ChalkIr> { |
| 224 | + constant |
| 225 | + } |
| 226 | + |
| 227 | + fn const_eq(&self, _ty: &Arc<TyData<ChalkIr>>, c1: &u32, c2: &u32) -> bool { |
| 228 | + c1 == c2 |
| 229 | + } |
| 230 | + |
217 | 231 | fn intern_generic_arg(&self, generic_arg: GenericArgData<ChalkIr>) -> GenericArgData<ChalkIr> { |
218 | 232 | generic_arg |
219 | 233 | } |
|
0 commit comments