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/display.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/display.rs')
-rw-r--r-- | crates/ra_hir_ty/src/display.rs | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/crates/ra_hir_ty/src/display.rs b/crates/ra_hir_ty/src/display.rs index ac68c5661..c860c254c 100644 --- a/crates/ra_hir_ty/src/display.rs +++ b/crates/ra_hir_ty/src/display.rs | |||
@@ -243,10 +243,17 @@ impl HirDisplay for ApplicationTy { | |||
243 | write!(f, ")")?; | 243 | write!(f, ")")?; |
244 | } | 244 | } |
245 | } | 245 | } |
246 | TypeCtor::FnPtr { .. } => { | 246 | TypeCtor::FnPtr { is_varargs, .. } => { |
247 | let sig = FnSig::from_fn_ptr_substs(&self.parameters); | 247 | let sig = FnSig::from_fn_ptr_substs(&self.parameters, is_varargs); |
248 | write!(f, "fn(")?; | 248 | write!(f, "fn(")?; |
249 | f.write_joined(sig.params(), ", ")?; | 249 | f.write_joined(sig.params(), ", ")?; |
250 | if is_varargs { | ||
251 | if sig.params().is_empty() { | ||
252 | write!(f, "...")?; | ||
253 | } else { | ||
254 | write!(f, ", ...")?; | ||
255 | } | ||
256 | } | ||
250 | write!(f, ")")?; | 257 | write!(f, ")")?; |
251 | let ret = sig.ret(); | 258 | let ret = sig.ret(); |
252 | if *ret != Ty::unit() { | 259 | if *ret != Ty::unit() { |