mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 06:41:48 +00:00
Rewrite coercion using the new unification
This commit is contained in:
parent
84074cb185
commit
693582946f
6 changed files with 381 additions and 115 deletions
|
@ -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]
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue