rust/compiler/rustc_pattern_analysis/src
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
..
rustc clean up witness printing for tuple-like constructors 2025-08-10 16:34:11 -07:00
checks.rs always check for mixed deref pattern and normal constructors 2025-07-04 23:47:31 -07:00
constructor.rs In rustc_pattern_analysis, put true witnesses before false witnesses 2025-07-28 02:01:39 +03:00
errors.rs error early when mixing deref patterns with normal constructors 2025-05-06 18:53:55 -07:00
lib.rs pattern_analysis: add option to get a full set of witnesses 2025-07-20 18:27:30 +02:00
lints.rs Remove LintExpectationId from Level variants 2025-04-03 09:22:21 +00:00
pat.rs Reformat using the new identifier sorting from rustfmt 2024-09-22 19:11:29 -04:00
pat_column.rs Greatly simplify lifetime captures in edition 2024 2025-02-22 22:24:52 +00:00
rustc.rs avoid unnecessary type sanity checks 2025-08-14 09:44:22 +02:00
usefulness.rs List all the variants of non-exhaustive enums in exhaustive mode 2025-07-20 18:27:30 +02:00