Rewrite coercion using the new unification

This commit is contained in:
Florian Diebold 2021-05-01 21:53:10 +02:00
parent 84074cb185
commit 693582946f
6 changed files with 381 additions and 115 deletions

View file

@ -203,6 +203,17 @@ impl CallableSig {
}
}
pub fn to_fn_ptr(&self) -> FnPointer {
FnPointer {
num_binders: 0,
sig: FnSig { abi: (), safety: Safety::Safe, variadic: self.is_varargs },
substitution: FnSubst(Substitution::from_iter(
&Interner,
self.params_and_return.iter().cloned(),
)),
}
}
pub fn params(&self) -> &[Ty] {
&self.params_and_return[0..self.params_and_return.len() - 1]
}