aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/traits
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-04-08 19:13:21 +0100
committerFlorian Diebold <[email protected]>2021-04-08 21:48:47 +0100
commit15b0b55b4e73fb25d94dd9bcc49a2b4ed5156dc1 (patch)
treed5cb4dbc46c5d16dbc35f79ad4191b301a7b6e6b /crates/hir_ty/src/traits
parent317c4b972f5f8da9b5007b8a441a5a79a60a4cd5 (diff)
Intern ProgramClauses
Diffstat (limited to 'crates/hir_ty/src/traits')
-rw-r--r--crates/hir_ty/src/traits/chalk/interner.rs5
1 files changed, 3 insertions, 2 deletions
diff --git a/crates/hir_ty/src/traits/chalk/interner.rs b/crates/hir_ty/src/traits/chalk/interner.rs
index d63252382..11fa2622d 100644
--- a/crates/hir_ty/src/traits/chalk/interner.rs
+++ b/crates/hir_ty/src/traits/chalk/interner.rs
@@ -57,6 +57,7 @@ impl_internable!(
57 InternedWrapper<chalk_ir::LifetimeData<Interner>>, 57 InternedWrapper<chalk_ir::LifetimeData<Interner>>,
58 InternedWrapper<chalk_ir::ConstData<Interner>>, 58 InternedWrapper<chalk_ir::ConstData<Interner>>,
59 InternedWrapper<Vec<chalk_ir::CanonicalVarKind<Interner>>>, 59 InternedWrapper<Vec<chalk_ir::CanonicalVarKind<Interner>>>,
60 InternedWrapper<Vec<chalk_ir::ProgramClause<Interner>>>,
60); 61);
61 62
62impl chalk_ir::interner::Interner for Interner { 63impl chalk_ir::interner::Interner for Interner {
@@ -69,7 +70,7 @@ impl chalk_ir::interner::Interner for Interner {
69 type InternedGoals = Vec<Goal<Self>>; 70 type InternedGoals = Vec<Goal<Self>>;
70 type InternedSubstitution = Interned<InternedSubstitutionInner>; 71 type InternedSubstitution = Interned<InternedSubstitutionInner>;
71 type InternedProgramClause = Arc<chalk_ir::ProgramClauseData<Self>>; 72 type InternedProgramClause = Arc<chalk_ir::ProgramClauseData<Self>>;
72 type InternedProgramClauses = Arc<[chalk_ir::ProgramClause<Self>]>; 73 type InternedProgramClauses = Interned<InternedWrapper<Vec<chalk_ir::ProgramClause<Self>>>>;
73 type InternedQuantifiedWhereClauses = Vec<chalk_ir::QuantifiedWhereClause<Self>>; 74 type InternedQuantifiedWhereClauses = Vec<chalk_ir::QuantifiedWhereClause<Self>>;
74 type InternedVariableKinds = Interned<InternedVariableKindsInner>; 75 type InternedVariableKinds = Interned<InternedVariableKindsInner>;
75 type InternedCanonicalVarKinds = Interned<InternedWrapper<Vec<chalk_ir::CanonicalVarKind<Self>>>>; 76 type InternedCanonicalVarKinds = Interned<InternedWrapper<Vec<chalk_ir::CanonicalVarKind<Self>>>>;
@@ -327,7 +328,7 @@ impl chalk_ir::interner::Interner for Interner {
327 &self, 328 &self,
328 data: impl IntoIterator<Item = Result<chalk_ir::ProgramClause<Self>, E>>, 329 data: impl IntoIterator<Item = Result<chalk_ir::ProgramClause<Self>, E>>,
329 ) -> Result<Self::InternedProgramClauses, E> { 330 ) -> Result<Self::InternedProgramClauses, E> {
330 data.into_iter().collect() 331 Ok(Interned::new(InternedWrapper(data.into_iter().collect::<Result<_, _>>()?)))
331 } 332 }
332 333
333 fn program_clauses_data<'a>( 334 fn program_clauses_data<'a>(