From 9449b786218d5c5b66222a774f445e1ccf3e3666 Mon Sep 17 00:00:00 2001 From: dianne Date: Sun, 10 Aug 2025 15:32:14 -0700 Subject: show a trailing comma on singleton tuple constructors in witness pats --- compiler/rustc_pattern_analysis/src/rustc/print.rs | 3 +++ 1 file changed, 3 insertions(+) (limited to 'compiler/rustc_pattern_analysis') diff --git a/compiler/rustc_pattern_analysis/src/rustc/print.rs b/compiler/rustc_pattern_analysis/src/rustc/print.rs index 7649f72f868..022fac2a826 100644 --- a/compiler/rustc_pattern_analysis/src/rustc/print.rs +++ b/compiler/rustc_pattern_analysis/src/rustc/print.rs @@ -119,6 +119,9 @@ pub(crate) fn write_struct_like<'tcx>( write!(f, "_")?; } } + if matches!(ty.kind(), ty::Tuple(..)) && num_fields == 1 { + write!(f, ",")?; + } write!(f, ")")?; } -- cgit 1.4.1-3-g733a5