1
Fork 0

Pack Term in the same way as GenericArg.

This shrinks the `PredicateS` type, which is instanted frequently.
This commit is contained in:
Nicholas Nethercote 2022-09-05 14:03:53 +10:00
parent d565d51071
commit 79db32b64e
20 changed files with 191 additions and 108 deletions

View file

@ -353,12 +353,11 @@ pub enum ValuePairs<'tcx> {
impl<'tcx> ValuePairs<'tcx> {
pub fn ty(&self) -> Option<(Ty<'tcx>, Ty<'tcx>)> {
if let ValuePairs::Terms(ExpectedFound {
expected: ty::Term::Ty(expected),
found: ty::Term::Ty(found),
}) = self
if let ValuePairs::Terms(ExpectedFound { expected, found }) = self
&& let Some(expected) = expected.ty()
&& let Some(found) = found.ty()
{
Some((*expected, *found))
Some((expected, found))
} else {
None
}