Properly handle lifetimes when checking generic arguments len

And also, prepare for correct lowering of lifetime. We still don't handle most lifetimes correctly, but a bit more of the foundation to lifetime elision is now implemented.
This commit is contained in:
Chayim Refael Friedman 2025-04-24 08:35:20 +03:00
parent 3d00e247dd
commit adcf699ea3
16 changed files with 858 additions and 226 deletions

View file

@ -106,6 +106,14 @@ pub struct FnType {
pub abi: Option<Symbol>,
}
impl FnType {
#[inline]
pub fn split_params_and_ret(&self) -> (&[(Option<Name>, TypeRefId)], TypeRefId) {
let (ret, params) = self.params.split_last().expect("should have at least return type");
(params, ret.1)
}
}
#[derive(Clone, PartialEq, Eq, Hash, Debug)]
pub struct ArrayType {
pub ty: TypeRefId,