rust/compiler/rustc_pattern_analysis
Samuel Tardieu 5a14685a63
Rollup merge of #145234 - dianne:1-tuple-witnesses, r=jackh726
match exhaustiveness diagnostics: show a trailing comma on singleton tuple consructors in witness patterns (and clean up a little)

Constructor patterns of type `(T,)` are written `(pat,)`, not `(pat)`. However, exhaustiveness/usefulness diagnostics would print them as `(pat)` when e.g. providing a witness of non-exhaustiveness and suggesting adding arms to make matches exhaustive; this would result in an error when applied.
rust-analyzer already prints the trailing comma, so it doesn't need changing.

This also includes some cleanup in the second commit, with justification in the commit message.
2025-08-23 22:22:15 +02:00
..
src Rollup merge of #145234 - dianne:1-tuple-witnesses, r=jackh726 2025-08-23 22:22:15 +02:00
tests In rustc_pattern_analysis, put true witnesses before false witnesses 2025-07-28 02:01:39 +03:00
Cargo.toml Tidy up Cargo.toml files. 2025-07-31 19:58:04 +10:00
messages.ftl error early when mixing deref patterns with normal constructors 2025-05-06 18:53:55 -07:00