aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_hir_ty/src/traits
diff options
context:
space:
mode:
authorJonas Schievink <[email protected]>2020-07-14 17:23:45 +0100
committerJonas Schievink <[email protected]>2020-07-14 19:27:47 +0100
commita09d48380204fa948a3af397dc2188b93bf5793f (patch)
treee38436638e0987a8ed2d68a646a35080a5e4c6d3 /crates/ra_hir_ty/src/traits
parent3f2ab436f45a4fae32514756736055819ead2baa (diff)
Thread varargs through r-a
Diffstat (limited to 'crates/ra_hir_ty/src/traits')
-rw-r--r--crates/ra_hir_ty/src/traits/builtin.rs2
-rw-r--r--crates/ra_hir_ty/src/traits/chalk/mapping.rs7
2 files changed, 6 insertions, 3 deletions
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(
121 .build(), 121 .build(),
122 ); 122 );
123 let sig_ty = Ty::apply( 123 let sig_ty = Ty::apply(
124 TypeCtor::FnPtr { num_args }, 124 TypeCtor::FnPtr { num_args, is_varargs: false },
125 Substs::builder(num_args as usize + 1) 125 Substs::builder(num_args as usize + 1)
126 .fill_with_bound_vars(DebruijnIndex::INNERMOST, 0) 126 .fill_with_bound_vars(DebruijnIndex::INNERMOST, 0)
127 .build(), 127 .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 {
30 Ty::Apply(apply_ty) => match apply_ty.ctor { 30 Ty::Apply(apply_ty) => match apply_ty.ctor {
31 TypeCtor::Ref(m) => ref_to_chalk(db, m, apply_ty.parameters), 31 TypeCtor::Ref(m) => ref_to_chalk(db, m, apply_ty.parameters),
32 TypeCtor::Array => array_to_chalk(db, apply_ty.parameters), 32 TypeCtor::Array => array_to_chalk(db, apply_ty.parameters),
33 TypeCtor::FnPtr { num_args: _ } => { 33 TypeCtor::FnPtr { num_args: _, is_varargs: _ } => {
34 let substitution = apply_ty.parameters.to_chalk(db).shifted_in(&Interner); 34 let substitution = apply_ty.parameters.to_chalk(db).shifted_in(&Interner);
35 chalk_ir::TyData::Function(chalk_ir::Fn { num_binders: 0, substitution }) 35 chalk_ir::TyData::Function(chalk_ir::Fn { num_binders: 0, substitution })
36 .intern(&Interner) 36 .intern(&Interner)
@@ -124,7 +124,10 @@ impl ToChalk for Ty {
124 substitution.shifted_out(&Interner).expect("fn ptr should have no binders"), 124 substitution.shifted_out(&Interner).expect("fn ptr should have no binders"),
125 ); 125 );
126 Ty::Apply(ApplicationTy { 126 Ty::Apply(ApplicationTy {
127 ctor: TypeCtor::FnPtr { num_args: (parameters.len() - 1) as u16 }, 127 ctor: TypeCtor::FnPtr {
128 num_args: (parameters.len() - 1) as u16,
129 is_varargs: false,
130 },
128 parameters, 131 parameters,
129 }) 132 })
130 } 133 }