diff options
| author | dianne <diannes.gm@gmail.com> | 2025-08-10 15:32:14 -0700 |
|---|---|---|
| committer | dianne <diannes.gm@gmail.com> | 2025-08-10 15:32:14 -0700 |
| commit | 9449b786218d5c5b66222a774f445e1ccf3e3666 (patch) | |
| tree | 3fd27a94fe12a3af63c3d274515785818cdfcd33 /compiler/rustc_pattern_analysis | |
| parent | 29737cb44beb67dbcf001ca1f11b7ec8964d8d06 (diff) | |
| download | rust-9449b786218d5c5b66222a774f445e1ccf3e3666.tar.gz rust-9449b786218d5c5b66222a774f445e1ccf3e3666.zip | |
show a trailing comma on singleton tuple constructors in witness pats
Diffstat (limited to 'compiler/rustc_pattern_analysis')
| -rw-r--r-- | compiler/rustc_pattern_analysis/src/rustc/print.rs | 3 |
1 files changed, 3 insertions, 0 deletions
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, ")")?; } |
