aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/hir_ty/src/lib.rs5
1 files changed, 4 insertions, 1 deletions
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<Interner>;
110 110
111// FIXME: get rid of this 111// FIXME: get rid of this
112pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution { 112pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution {
113 Substitution::intern(s.interned()[..std::cmp::min(s.len(&Interner), n)].into()) 113 Substitution::from_iter(
114 &Interner,
115 s.interned()[..std::cmp::min(s.len(&Interner), n)].iter().cloned(),
116 )
114} 117}
115 118
116/// Return an index of a parameter in the generic type parameter list by it's id. 119/// Return an index of a parameter in the generic type parameter list by it's id.