aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/hir_ty/src/lib.rs')
-rw-r--r--crates/hir_ty/src/lib.rs11
1 files changed, 11 insertions, 0 deletions
diff --git a/crates/hir_ty/src/lib.rs b/crates/hir_ty/src/lib.rs
index 15b61bedc..179a27763 100644
--- a/crates/hir_ty/src/lib.rs
+++ b/crates/hir_ty/src/lib.rs
@@ -203,6 +203,17 @@ impl CallableSig {
203 } 203 }
204 } 204 }
205 205
206 pub fn to_fn_ptr(&self) -> FnPointer {
207 FnPointer {
208 num_binders: 0,
209 sig: FnSig { abi: (), safety: Safety::Safe, variadic: self.is_varargs },
210 substitution: FnSubst(Substitution::from_iter(
211 &Interner,
212 self.params_and_return.iter().cloned(),
213 )),
214 }
215 }
216
206 pub fn params(&self) -> &[Ty] { 217 pub fn params(&self) -> &[Ty] {
207 &self.params_and_return[0..self.params_and_return.len() - 1] 218 &self.params_and_return[0..self.params_and_return.len() - 1]
208 } 219 }