From a09d48380204fa948a3af397dc2188b93bf5793f Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Tue, 14 Jul 2020 18:23:45 +0200 Subject: Thread varargs through r-a --- crates/ra_hir_ty/src/traits/builtin.rs | 2 +- crates/ra_hir_ty/src/traits/chalk/mapping.rs | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) (limited to 'crates/ra_hir_ty/src/traits') diff --git a/crates/ra_hir_ty/src/traits/builtin.rs b/crates/ra_hir_ty/src/traits/builtin.rs index 86e22e459..60cc9a9f5 100644 --- a/crates/ra_hir_ty/src/traits/builtin.rs +++ b/crates/ra_hir_ty/src/traits/builtin.rs @@ -121,7 +121,7 @@ fn closure_fn_trait_impl_datum( .build(), ); let sig_ty = Ty::apply( - TypeCtor::FnPtr { num_args }, + TypeCtor::FnPtr { num_args, is_varargs: false }, Substs::builder(num_args as usize + 1) .fill_with_bound_vars(DebruijnIndex::INNERMOST, 0) .build(), diff --git a/crates/ra_hir_ty/src/traits/chalk/mapping.rs b/crates/ra_hir_ty/src/traits/chalk/mapping.rs index 06453ef82..5ba2ff51b 100644 --- a/crates/ra_hir_ty/src/traits/chalk/mapping.rs +++ b/crates/ra_hir_ty/src/traits/chalk/mapping.rs @@ -30,7 +30,7 @@ impl ToChalk for Ty { Ty::Apply(apply_ty) => match apply_ty.ctor { TypeCtor::Ref(m) => ref_to_chalk(db, m, apply_ty.parameters), TypeCtor::Array => array_to_chalk(db, apply_ty.parameters), - TypeCtor::FnPtr { num_args: _ } => { + TypeCtor::FnPtr { num_args: _, is_varargs: _ } => { let substitution = apply_ty.parameters.to_chalk(db).shifted_in(&Interner); chalk_ir::TyData::Function(chalk_ir::Fn { num_binders: 0, substitution }) .intern(&Interner) @@ -124,7 +124,10 @@ impl ToChalk for Ty { substitution.shifted_out(&Interner).expect("fn ptr should have no binders"), ); Ty::Apply(ApplicationTy { - ctor: TypeCtor::FnPtr { num_args: (parameters.len() - 1) as u16 }, + ctor: TypeCtor::FnPtr { + num_args: (parameters.len() - 1) as u16, + is_varargs: false, + }, parameters, }) } -- cgit v1.2.3