From 317c4b972f5f8da9b5007b8a441a5a79a60a4cd5 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Thu, 8 Apr 2021 20:06:19 +0200 Subject: Intern CanonicalVarKinds Slight savings in performance and memory. --- 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 3a6ceef05..d63252382 100644 --- a/crates/hir_ty/src/traits/chalk/interner.rs +++ b/crates/hir_ty/src/traits/chalk/interner.rs @@ -56,6 +56,7 @@ impl_internable!( InternedTypeInner, InternedWrapper>, InternedWrapper>, + InternedWrapper>>, ); impl chalk_ir::interner::Interner for Interner { @@ -71,7 +72,7 @@ impl chalk_ir::interner::Interner for Interner { type InternedProgramClauses = Arc<[chalk_ir::ProgramClause]>; type InternedQuantifiedWhereClauses = Vec>; type InternedVariableKinds = Interned; - type InternedCanonicalVarKinds = Vec>; + type InternedCanonicalVarKinds = Interned>>>; type InternedConstraints = Vec>>; type InternedVariances = Arc<[chalk_ir::Variance]>; type DefId = InternId; @@ -370,7 +371,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 canonical_var_kinds_data<'a>( -- cgit v1.2.3