Unnamed repository; edit this file 'description' to name the repository.
Diffstat (limited to 'crates/hir-ty/src/infer.rs')
-rw-r--r--crates/hir-ty/src/infer.rs4
1 files changed, 3 insertions, 1 deletions
diff --git a/crates/hir-ty/src/infer.rs b/crates/hir-ty/src/infer.rs
index 82f4ad01e0..284291bb9a 100644
--- a/crates/hir-ty/src/infer.rs
+++ b/crates/hir-ty/src/infer.rs
@@ -812,7 +812,9 @@ impl<'a> InferenceContext<'a> {
None => self.err_ty(),
};
- param_tys.push(va_list_ty)
+ if let Some(ty) = param_tys.last_mut() {
+ *ty = va_list_ty;
+ }
}
let mut param_tys = param_tys.into_iter().chain(iter::repeat(self.table.new_type_var()));
if let Some(self_param) = self.body.self_param {