diff options
author | Florian Diebold <[email protected]> | 2021-04-07 20:17:51 +0100 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2021-04-08 13:08:55 +0100 |
commit | dc0b5817366f9b7b99a1a1f6e69ca7ac63e9ed0f (patch) | |
tree | ae18691db7973896bec7098824027752f2358f03 | |
parent | 5794a090bf8609d695d7e9fd1c3df8d0ca56a708 (diff) |
Fix subst_prefix
-rw-r--r-- | crates/hir_ty/src/lib.rs | 5 |
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 |
112 | pub fn subst_prefix(s: &Substitution, n: usize) -> Substitution { | 112 | pub 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. |