aboutsummaryrefslogtreecommitdiff
path: root/crates/hir_ty/src/lib.rs
diff options
context:
space:
mode:
authorFlorian Diebold <[email protected]>2021-05-01 20:53:10 +0100
committerFlorian Diebold <[email protected]>2021-05-21 16:48:33 +0100
commit693582946fae1813627ad59f60a31c9237e98744 (patch)
tree7c546542a5e76b8e1a958f867faddd1c04b05d07 /crates/hir_ty/src/lib.rs
parent84074cb1852aa702e1307e9533e1fa3448e3e04f (diff)
Rewrite coercion using the new unification
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 }