diff options
author | Florian Diebold <[email protected]> | 2020-02-07 15:39:48 +0000 |
---|---|---|
committer | Florian Diebold <[email protected]> | 2020-02-07 17:28:11 +0000 |
commit | b0bb8622eea7cb447ebadb8b5fba43850305e913 (patch) | |
tree | a69260471cb2930dc3a7f87e2662a503fe95453c /crates/ra_hir_ty/src/lib.rs | |
parent | 6c70619b0126bc0e40bd9df39dcd6e711cac69c5 (diff) |
Don't print implicit type args from impl Trait
Diffstat (limited to 'crates/ra_hir_ty/src/lib.rs')
-rw-r--r-- | crates/ra_hir_ty/src/lib.rs | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/crates/ra_hir_ty/src/lib.rs b/crates/ra_hir_ty/src/lib.rs index 60c7fd0e5..68c2f0b06 100644 --- a/crates/ra_hir_ty/src/lib.rs +++ b/crates/ra_hir_ty/src/lib.rs | |||
@@ -909,9 +909,16 @@ impl HirDisplay for ApplicationTy { | |||
909 | } | 909 | } |
910 | } | 910 | } |
911 | if self.parameters.len() > 0 { | 911 | if self.parameters.len() > 0 { |
912 | write!(f, "<")?; | 912 | let generics = generics(f.db, def.into()); |
913 | f.write_joined(&*self.parameters.0, ", ")?; | 913 | let (parent_params, self_param, type_params, _impl_trait_params) = |
914 | write!(f, ">")?; | 914 | generics.provenance_split(); |
915 | let total_len = parent_params + self_param + type_params; | ||
916 | // We print all params except implicit impl Trait params. Still a bit weird; should we leave out parent and self? | ||
917 | if total_len > 0 { | ||
918 | write!(f, "<")?; | ||
919 | f.write_joined(&self.parameters.0[..total_len], ", ")?; | ||
920 | write!(f, ">")?; | ||
921 | } | ||
915 | } | 922 | } |
916 | write!(f, "(")?; | 923 | write!(f, "(")?; |
917 | f.write_joined(sig.params(), ", ")?; | 924 | f.write_joined(sig.params(), ", ")?; |