From 601dc50b5ae0f8c0120b429d3e1fb703a26d3d0b Mon Sep 17 00:00:00 2001 From: Jonas Schievink Date: Mon, 10 Jan 2022 16:55:53 +0100 Subject: [PATCH] Print a single ellipsis for any number of omitted types --- crates/hir_ty/src/display.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/crates/hir_ty/src/display.rs b/crates/hir_ty/src/display.rs index 95d1550afc3..f02f4ac0247 100644 --- a/crates/hir_ty/src/display.rs +++ b/crates/hir_ty/src/display.rs @@ -151,6 +151,12 @@ pub fn write_joined( 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(())