rust/compiler/rustc_pattern_analysis/src
bors 49649bf3c5 Auto merge of #128015 - Nadrieril:two-step-or-expansion, r=compiler-errors
match exhaustiveness: Expand or-patterns as a separate step

To compute exhaustiveness, we must expand or-patterns. Previously, we expanded them at the same time that we pushed patterns into the matrix. This made it harder to track pattern reachability, because the or-pattern itself would never show up in the matrix so we had to recover missing information.

This PR changes that: we no longer expand or-patterns as we push them into the matrix. Instead, if we find an or-pattern in the matrix we expand them in a step very much like the specialization we already do. This simplifies a bunch of things, and should greatly simplify the implementation of https://github.com/rust-lang/rust/issues/127870.

r? `@compiler-errors`
2024-07-23 06:35:42 +00:00
..
constructor.rs Avoid ref when using format! in compiler 2024-07-19 14:52:07 -04:00
errors.rs Pass translation closure to add_to_diag_with() as reference 2024-04-21 07:45:03 +00:00
lib.rs Avoid comments that describe multiple use items. 2024-07-17 08:02:46 +10:00
lints.rs Remove LintDiagnostic::msg 2024-05-23 04:08:35 +02:00
pat_column.rs Rename TypeCx -> PatCx 2024-03-13 13:56:38 +01:00
pat.rs Expand or-patterns as a separate step 2024-07-20 22:28:54 +02:00
rustc.rs Tweak collect_non_exhaustive_tys 2024-07-21 15:24:27 +02:00
usefulness.rs Expand or-patterns as a separate step 2024-07-20 22:28:54 +02:00