Zalathar
fc55129774
Remove print::Pat
entirely, replacing it with String
2024-08-11 20:25:03 +10:00
Zalathar
bfe88a3bd0
Remove PatKind::Never
2024-08-11 19:57:30 +10:00
Zalathar
ec1483bf2e
Remove PatKind::Slice
2024-08-11 19:57:30 +10:00
Zalathar
2b6f4386eb
Remove PatKind::Range
2024-08-11 19:57:30 +10:00
Zalathar
9952e4d4c8
Remove PatKind::Constant
2024-08-11 19:57:30 +10:00
Zalathar
283243ac5a
Remove PatKind::Ref
2024-08-11 19:57:30 +10:00
Zalathar
15cc0e1b5c
Remove PatKind::Box
2024-08-11 19:57:30 +10:00
Zalathar
ed3e38f336
Remove PatKind::StructLike
2024-08-11 19:57:30 +10:00
Zalathar
92eb159d04
Remove PatKind::Wild
2024-08-11 19:57:30 +10:00
Zalathar
f53eb2724d
Add print::PatKind::Print
...
This will allow for the gradual removal of all other variants.
2024-08-11 19:57:30 +10:00
Zalathar
0a777090d8
Avoid matching on PatKind::Wild
in write_struct_like
2024-08-11 19:57:30 +10:00
Zalathar
482412c98a
Use TyCtxt::is_diagnostic_item
2024-08-07 21:44:53 +10:00
Zalathar
29245ec759
Avoid using ty::tls::with
in write_struct_like
2024-08-07 21:44:53 +10:00
Zalathar
a5ed6fb646
Split out hoisting/printing of box
patterns
2024-08-07 20:52:47 +10:00
Zalathar
e98e19e491
Replace an unnecessary slice pattern with has_dot_dot: bool
2024-08-07 20:52:46 +10:00
Zalathar
4cd800503f
Remove an impossible case under EnumInfo::NotEnum
2024-08-07 20:52:46 +10:00
Zalathar
74f76ae5ea
Unify Variant
and Leaf
into print::PatKind::StructLike
2024-08-07 20:52:46 +10:00
Zalathar
ccfd94e334
Break up print::Pat
printing into several helper functions
2024-08-07 20:52:46 +10:00
Zalathar
dd5a8d7714
Use a separate pattern type for rustc_pattern_analysis
diagnostics
...
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.
2024-07-31 16:03:27 +10:00