From dc0b5817366f9b7b99a1a1f6e69ca7ac63e9ed0f Mon Sep 17 00:00:00 2001 From: Florian Diebold Date: Wed, 7 Apr 2021 21:17:51 +0200 Subject: Fix subst_prefix --- crates/hir_ty/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index 0954d495c..78ae3545a 100644 --- a/crates/hir_ty/src/lib.rs +++ b/crates/hir_ty/src/lib.rs @@ -110,7 +110,10 @@ pub type WhereClause = chalk_ir::WhereClause; // FIXME: get rid of this pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution { - Substitution::intern(s.interned()[..std::cmp::min(s.len(&Interner), n)].into()) + Substitution::from_iter( + &Interner, + s.interned()[..std::cmp::min(s.len(&Interner), n)].iter().cloned(), + ) } /// Return an index of a parameter in the generic type parameter list by it's id. -- cgit v1.2.3