Skip to content

Commit 15b0b55

Browse files
committed
Intern ProgramClauses
1 parent 317c4b9 commit 15b0b55

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

crates/hir_ty/src/traits/chalk/interner.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ impl_internable!(
5757
InternedWrapper<chalk_ir::LifetimeData<Interner>>,
5858
InternedWrapper<chalk_ir::ConstData<Interner>>,
5959
InternedWrapper<Vec<chalk_ir::CanonicalVarKind<Interner>>>,
60+
InternedWrapper<Vec<chalk_ir::ProgramClause<Interner>>>,
6061
);
6162

6263
impl chalk_ir::interner::Interner for Interner {
@@ -69,7 +70,7 @@ impl chalk_ir::interner::Interner for Interner {
6970
type InternedGoals = Vec<Goal<Self>>;
7071
type InternedSubstitution = Interned<InternedSubstitutionInner>;
7172
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>>>>;
7374
type InternedQuantifiedWhereClauses = Vec<chalk_ir::QuantifiedWhereClause<Self>>;
7475
type InternedVariableKinds = Interned<InternedVariableKindsInner>;
7576
type InternedCanonicalVarKinds = Interned<InternedWrapper<Vec<chalk_ir::CanonicalVarKind<Self>>>>;
@@ -327,7 +328,7 @@ impl chalk_ir::interner::Interner for Interner {
327328
&self,
328329
data: impl IntoIterator<Item = Result<chalk_ir::ProgramClause<Self>, E>>,
329330
) -> Result<Self::InternedProgramClauses, E> {
330-
data.into_iter().collect()
331+
Ok(Interned::new(InternedWrapper(data.into_iter().collect::<Result<_, _>>()?)))
331332
}
332333

333334
fn program_clauses_data<'a>(

0 commit comments

Comments
 (0)