aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--crates/hir_ty/src/lib.rs18
1 files changed, 18 insertions, 0 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs
index 23dec7040..0954d495c 100644
--- a/crates/hir_ty/src/lib.rs
+++ b/crates/hir_ty/src/lib.rs
@@ -35,6 +35,7 @@ use std::sync::Arc;
35use base_db::salsa; 35use base_db::salsa;
36use chalk_ir::{ 36use chalk_ir::{
37 cast::{CastTo, Caster}, 37 cast::{CastTo, Caster},
38 fold::Fold,
38 interner::HasInterner, 39 interner::HasInterner,
39 UintTy, 40 UintTy,
40}; 41};
@@ -203,6 +204,23 @@ impl CallableSig {
203 } 204 }
204} 205}
205 206
207impl Fold<Interner> for CallableSig {
208 type Result = CallableSig;
209
210 fn fold_with<'i>(
211 self,
212 folder: &mut dyn chalk_ir::fold::Folder<'i, Interner>,
213 outer_binder: DebruijnIndex,
214 ) -> chalk_ir::Fallible<Self::Result>
215 where
216 Interner: 'i,
217 {
218 let vec = self.params_and_return.to_vec();
219 let folded = vec.fold_with(folder, outer_binder)?;
220 Ok(CallableSig { params_and_return: folded.into(), is_varargs: self.is_varargs })
221 }
222}
223
206#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)] 224#[derive(Copy, Clone, PartialEq, Eq, Debug, Hash)]
207pub enum ImplTraitId { 225pub enum ImplTraitId {
208 ReturnTypeImplTrait(hir_def::FunctionId, u16), 226 ReturnTypeImplTrait(hir_def::FunctionId, u16),