From 417473aa3d53fb1a094031251af37ecd71e0cc09 Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Thu, 8 Apr 2021 20:55:03 +0200 Subject: Intern Variances This may be a slight performance improvement. --- crates/hir_ty/src/traits/chalk/interner.rs | 5 +++-- 1 file 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 f35695f6f..f2c9a0d4b 100644 --- a/crates/hir_ty/src/traits/chalk/interner.rs +++ b/crates/hir_ty/src/traits/chalk/interner.rs @@ -59,6 +59,7 @@ impl_internable!( InternedWrapper>>, InternedWrapper>>, InternedWrapper>>, + InternedWrapper>, ); impl chalk_ir::interner::Interner for Interner { @@ -76,7 +77,7 @@ impl chalk_ir::interner::Interner for Interner { type InternedVariableKinds = Interned; type InternedCanonicalVarKinds = Interned>>>; type InternedConstraints = Vec>>; - type InternedVariances = Arc<[chalk_ir::Variance]>; + type InternedVariances = Interned>>; type DefId = InternId; type InternedAdtId = hir_def::AdtId; type Identifier = TypeAliasId; @@ -413,7 +414,7 @@ impl chalk_ir::interner::Interner for Interner { &self, data: impl IntoIterator>, ) -> Result { - data.into_iter().collect() + Ok(Interned::new(InternedWrapper(data.into_iter().collect::>()?))) } fn variances_data<'a>( -- cgit v1.2.3