diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs index 0954d495c7..78ae3545a5 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.