diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2020-07-14 20:29:28 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2020-07-14 20:29:28 +0100 |
commit | fc2f761d654aa17f4af7d3c40cb9b31ea7d91ad0 (patch) | |
tree | 7418a329ccaa953b5b4c9d3718232c195e2abb46 /crates/ra_hir_ty/src/traits/chalk/mapping.rs | |
parent | 3f2ab436f45a4fae32514756736055819ead2baa (diff) | |
parent | fdce4d9f5140085c6c362ecbcf837f1b6a7d50ca (diff) |
Merge #5378
5378: Thread varargs through rust-analyzer r=flodiebold a=jonas-schievink
This adds a varargs flag to various data structures and fills it from the AST.
Fixes https://github.com/rust-analyzer/rust-analyzer/issues/5374
cc @flodiebold for the typesystem/chalk changes
Co-authored-by: Jonas Schievink <[email protected]>
Diffstat (limited to 'crates/ra_hir_ty/src/traits/chalk/mapping.rs')
-rw-r--r-- | crates/ra_hir_ty/src/traits/chalk/mapping.rs | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/traits/chalk/mapping.rs b/crates/ra_hir_ty/src/traits/chalk/mapping.rs index 06453ef82..3ebb55f77 100644 --- a/crates/ra_hir_ty/src/traits/chalk/mapping.rs +++ b/crates/ra_hir_ty/src/traits/chalk/mapping.rs | |||
@@ -30,7 +30,8 @@ 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 | // FIXME: handle is_varargs | ||
34 | let substitution = apply_ty.parameters.to_chalk(db).shifted_in(&Interner); | 35 | let substitution = apply_ty.parameters.to_chalk(db).shifted_in(&Interner); |
35 | chalk_ir::TyData::Function(chalk_ir::Fn { num_binders: 0, substitution }) | 36 | chalk_ir::TyData::Function(chalk_ir::Fn { num_binders: 0, substitution }) |
36 | .intern(&Interner) | 37 | .intern(&Interner) |
@@ -124,7 +125,10 @@ impl ToChalk for Ty { | |||
124 | substitution.shifted_out(&Interner).expect("fn ptr should have no binders"), | 125 | substitution.shifted_out(&Interner).expect("fn ptr should have no binders"), |
125 | ); | 126 | ); |
126 | Ty::Apply(ApplicationTy { | 127 | Ty::Apply(ApplicationTy { |
127 | ctor: TypeCtor::FnPtr { num_args: (parameters.len() - 1) as u16 }, | 128 | ctor: TypeCtor::FnPtr { |
129 | num_args: (parameters.len() - 1) as u16, | ||
130 | is_varargs: false, | ||
131 | }, | ||
128 | parameters, | 132 | parameters, |
129 | }) | 133 | }) |
130 | } | 134 | } |