aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-04-07 20:17:51 +0100
committerFlorian Diebold <[email protected]>2021-04-08 13:08:55 +0100
commitdc0b5817366f9b7b99a1a1f6e69ca7ac63e9ed0f (patch)
treeae18691db7973896bec7098824027752f2358f03
parent5794a090bf8609d695d7e9fd1c3df8d0ca56a708 (diff)
Fix subst_prefix
-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.