Unnamed repository; edit this file 'description' to name the repository.
Merge #11247
11247: Print a single ellipsis for any number of omitted types r=jonas-schievink a=jonas-schievink Helps a little bit with https://github.com/rust-analyzer/rust-analyzer/issues/11240 bors r+ Co-authored-by: Jonas Schievink <[email protected]>
bors[bot] 2022-01-10
parent 0f8c96c · parent 601dc50 · commit 8dd58ce
-rw-r--r--crates/hir_ty/src/display.rs6
1 files changed, 6 insertions, 0 deletions
diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs
index 95d1550afc..f02f4ac024 100644
--- a/crates/hir_ty/src/display.rs
+++ b/crates/hir_ty/src/display.rs
@@ -151,6 +151,12 @@ impl<'a> HirFormatter<'a> {
write!(self, "{}", sep)?;
}
first = false;
+
+ // Abbreviate multiple omitted types with a single ellipsis.
+ if self.should_truncate() {
+ return write!(self, "{}", TYPE_HINT_TRUNCATION);
+ }
+
e.hir_fmt(self)?;
}
Ok(())