This commit is contained in:
Jeroen Vannevel 2022-02-15 14:55:21 +00:00
parent 3bba811e92
commit 0a80cc82b1
No known key found for this signature in database
GPG key ID: 78EF5F52F38C49BD
3 changed files with 6 additions and 3 deletions

View file

@ -1103,9 +1103,10 @@ impl HirDisplay for TypeRef {
write!(f, "{}: ", name)?;
param_type.hir_fmt(f)?;
}
None => write!(f, " : {:?}", param_type)?,
None => param_type.hir_fmt(f)?,
};
// Last index contains the return type so we stop writing commas on the second-to-last index
if index != parameters.len() - 2 {
write!(f, ", ")?;
}

View file

@ -201,7 +201,7 @@ impl<'a> TyLoweringContext<'a> {
TypeRef::Placeholder => TyKind::Error.intern(Interner),
TypeRef::Fn(params, is_varargs) => {
let substs = self.with_shifted_in(DebruijnIndex::ONE, |ctx| {
Substitution::from_iter(Interner, params.iter().map(|tr| ctx.lower_ty(&tr.1)))
Substitution::from_iter(Interner, params.iter().map(|(_, tr)| ctx.lower_ty(tr)))
});
TyKind::Function(FnPointer {
num_binders: 0, // FIXME lower `for<'a> fn()` correctly