Add print::PatKind::Print

This will allow for the gradual removal of all other variants.
This commit is contained in:
Zalathar 2024-08-03 20:30:25 +10:00
parent 0a777090d8
commit f53eb2724d

View File

@ -62,6 +62,8 @@ pub(crate) enum PatKind<'tcx> {
},
Never,
Print(String),
}
impl<'tcx> fmt::Display for Pat<'tcx> {
@ -79,6 +81,7 @@ fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
PatKind::Slice { ref prefix, has_dot_dot, ref suffix } => {
write_slice_like(f, prefix, has_dot_dot, suffix)
}
PatKind::Print(ref string) => write!(f, "{string}"),
}
}
}