rust/tests/ui/or-patterns
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
..
already-bound-name.rs
already-bound-name.stderr
basic-switch.rs
basic-switchint.rs
bindings-runpass-1.rs
bindings-runpass-2.rs Add tests 2024-06-16 18:23:48 +02:00
box-patterns.rs
consistent-bindings.rs
const-fn.rs
exhaustiveness-non-exhaustive.rs show a trailing comma on singleton tuple constructors in witness pats 2025-08-10 15:32:14 -07:00
exhaustiveness-non-exhaustive.stderr show a trailing comma on singleton tuple constructors in witness pats 2025-08-10 15:32:14 -07:00
exhaustiveness-pass.rs
exhaustiveness-unreachable-pattern.rs Explain why a given pattern is considered unreachable 2024-07-24 08:02:55 +02:00
exhaustiveness-unreachable-pattern.stderr Reword the "unreachable pattern" explanations 2024-08-19 21:39:57 +02:00
fn-param-wrap-parens.fixed Error message for top-level or-patterns suggesting a solution 2025-05-09 22:16:34 +09:00
fn-param-wrap-parens.rs Error message for top-level or-patterns suggesting a solution 2025-05-09 22:16:34 +09:00
fn-param-wrap-parens.stderr Error message for top-level or-patterns suggesting a solution 2025-05-09 22:16:34 +09:00
for-loop.rs
if-let-while-let.rs
inconsistent-modes.rs
inconsistent-modes.stderr
inner-or-pat.or3.stderr Add tests 2024-06-16 18:23:48 +02:00
inner-or-pat.or4.stderr Add tests 2024-06-16 18:23:48 +02:00
inner-or-pat.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
issue-64879-trailing-before-guard.fixed Include whitespace in "remove |" suggestion and make it hidden 2025-08-04 18:06:18 +00:00
issue-64879-trailing-before-guard.rs Include whitespace in "remove |" suggestion and make it hidden 2025-08-04 18:06:18 +00:00
issue-64879-trailing-before-guard.stderr Include whitespace in "remove |" suggestion and make it hidden 2025-08-04 18:06:18 +00:00
issue-67514-irrefutable-param.rs
issue-68785-irrefutable-param-with-at.rs
issue-69875-should-have-been-expanded-earlier-non-exhaustive.rs
issue-69875-should-have-been-expanded-earlier-non-exhaustive.stderr Update tests for new TRPL chapter order 2024-11-23 08:57:25 -07:00
issue-69875-should-have-been-expanded-earlier.rs
issue-70413-no-unreachable-pat-and-guard.rs Add tests 2024-06-16 18:23:48 +02:00
lazy-and-or.rs Cleaned up 5 tests in tests/ui 2025-04-21 16:16:38 +09:00
let-pattern.rs
macro-pat.rs
mismatched-bindings-async-fn.rs
mismatched-bindings-async-fn.stderr
missing-bindings.rs
missing-bindings.stderr Filter empty lines, comments and delimiters from previous to last multiline span rendering 2024-12-12 23:36:27 +00:00
mix-with-wild.rs
multiple-pattern-typo.rs
multiple-pattern-typo.stderr Show diff suggestion format on verbose replacement 2025-02-10 20:21:39 +00:00
nested-undelimited-precedence.rs Error message for top-level or-patterns suggesting a solution 2025-05-09 22:16:34 +09:00
nested-undelimited-precedence.stderr Error message for top-level or-patterns suggesting a solution 2025-05-09 22:16:34 +09:00
or-patterns-binding-type-mismatch.rs
or-patterns-binding-type-mismatch.stderr
or-patterns-default-binding-modes.rs
or-patterns-syntactic-fail-2018.rs Tweak more warnings. 2024-10-28 14:20:28 +11:00
or-patterns-syntactic-fail-2018.stderr Tweak more warnings. 2024-10-28 14:20:28 +11:00
or-patterns-syntactic-fail.rs Error message for top-level or-patterns suggesting a solution 2025-05-09 22:16:34 +09:00
or-patterns-syntactic-fail.stderr Error message for top-level or-patterns suggesting a solution 2025-05-09 22:16:34 +09:00
or-patterns-syntactic-pass-2021.rs
or-patterns-syntactic-pass.rs Use cfg(false) in UI tests 2025-04-03 21:41:58 +00:00
or-patterns-syntactic-pass.stderr
remove-leading-vert.fixed Include whitespace in "remove |" suggestion and make it hidden 2025-08-04 18:06:18 +00:00
remove-leading-vert.rs Include whitespace in "remove |" suggestion and make it hidden 2025-08-04 18:06:18 +00:00
remove-leading-vert.stderr Include whitespace in "remove |" suggestion and make it hidden 2025-08-04 18:06:18 +00:00
search-via-bindings.rs Add tests 2024-06-16 18:23:48 +02:00
simplification_subtleties.rs Add tests 2024-06-16 18:23:48 +02:00
slice-patterns.rs
struct-like.rs
while-parsing-this-or-pattern.rs UI tests: add missing diagnostic kinds where possible 2025-04-08 23:06:31 +03:00
while-parsing-this-or-pattern.stderr