about summary refs log tree commit diff
path: root/compiler/rustc_pattern_analysis/src/rustc
AgeCommit message (Collapse)AuthorLines
2025-08-10clean up witness printing for tuple-like constructorsdianne-17/+2
By construction, `subpatterns` contains all fields in order. Witness patterns are constructed with all fields in order by `WitnessPat::wild_from_ctor` and `WitnessStack::apply_constructor`, and the order is preserved at `write_struct_like`'s call-site in `print_witness_pat`. It's thus no longer necessary to go looking for fields or handle missing fields.
2025-08-10show a trailing comma on singleton tuple constructors in witness patsdianne-0/+3
2024-10-27compiler: Add rustc_abi dependence to the compilerJubilee Young-1/+1
Depend on rustc_abi in compiler crates that use it indirectly but have not yet taken on that dependency, and are not entangled in my other PRs. This leaves an "excise rustc_target" step after the dust settles.
2024-08-11Remove `print::Pat` entirely, replacing it with `String`Zalathar-27/+7
2024-08-11Remove `PatKind::Never`Zalathar-3/+0
2024-08-11Remove `PatKind::Slice`Zalathar-14/+3
2024-08-11Remove `PatKind::Range`Zalathar-4/+0
2024-08-11Remove `PatKind::Constant`Zalathar-6/+1
2024-08-11Remove `PatKind::Ref`Zalathar-6/+2
2024-08-11Remove `PatKind::Box`Zalathar-5/+0
2024-08-11Remove `PatKind::StructLike`Zalathar-9/+1
2024-08-11Remove `PatKind::Wild`Zalathar-3/+0
2024-08-11Add `print::PatKind::Print`Zalathar-0/+3
This will allow for the gradual removal of all other variants.
2024-08-11Avoid matching on `PatKind::Wild` in `write_struct_like`Zalathar-4/+5
2024-08-07Use `TyCtxt::is_diagnostic_item`Zalathar-2/+2
2024-08-07Avoid using `ty::tls::with` in `write_struct_like`Zalathar-5/+6
2024-08-07Split out hoisting/printing of `box` patternsZalathar-1/+5
2024-08-07Replace an unnecessary slice pattern with `has_dot_dot: bool`Zalathar-11/+8
2024-08-07Remove an impossible case under `EnumInfo::NotEnum`Zalathar-7/+1
2024-08-07Unify `Variant` and `Leaf` into `print::PatKind::StructLike`Zalathar-13/+14
2024-08-07Break up `print::Pat` printing into several helper functionsZalathar-113/+142
2024-07-31Use a separate pattern type for `rustc_pattern_analysis` diagnosticsZalathar-0/+193
The pattern-analysis code needs to print patterns, as part of its user-visible diagnostics. But it never actually tries to print "real" patterns! Instead, it only ever prints synthetic patterns that it has reconstructed from its own internal represenations. We can therefore simultaneously remove two obstacles to changing `thir::Pat`, by having the pattern-analysis code use its own dedicated type for building printable patterns, and then making `thir::Pat` not printable at all.