From 566200342a2bed328d3e73bbb8b8bbe6d49f255c Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Thu, 8 Apr 2021 20:18:51 +0200 Subject: Intern QuantifiedWhereClauses Slight performance and memory usage improvement. --- crates/hir_ty/src/traits/chalk/interner.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'crates/hir_ty/src') diff --git a/crates/hir_ty/src/traits/chalk/interner.rs b/crates/hir_ty/src/traits/chalk/interner.rs index 11fa2622d..ea42be932 100644 --- a/crates/hir_ty/src/traits/chalk/interner.rs +++ b/crates/hir_ty/src/traits/chalk/interner.rs @@ -58,6 +58,7 @@ impl_internable!( InternedWrapper>, InternedWrapper>>, InternedWrapper>>, + InternedWrapper>>, ); impl chalk_ir::interner::Interner for Interner { @@ -71,7 +72,7 @@ impl chalk_ir::interner::Interner for Interner { type InternedSubstitution = Interned; type InternedProgramClause = Arc>; type InternedProgramClauses = Interned>>>; - type InternedQuantifiedWhereClauses = Vec>; + type InternedQuantifiedWhereClauses = Interned>>>; type InternedVariableKinds = Interned; type InternedCanonicalVarKinds = Interned>>>; type InternedConstraints = Vec>>; @@ -342,7 +343,7 @@ impl chalk_ir::interner::Interner for Interner { &self, data: impl IntoIterator, E>>, ) -> Result { - data.into_iter().collect() + Ok(Interned::new(InternedWrapper(data.into_iter().collect::>()?))) } fn quantified_where_clauses_data<'a>( -- cgit v1.2.3