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

@@ -543,9 +543,9 @@ impl<'tcx> Printer<'tcx> for &mut SymbolMangler<'tcx> {
let name = cx.tcx.associated_item(projection.item_def_id).name;
cx.push("p");
cx.push_ident(name.as_str());
cx = match projection.term {
ty::Term::Ty(ty) => ty.print(cx),
ty::Term::Const(c) => c.print(cx),
cx = match projection.term.unpack() {
ty::TermKind::Ty(ty) => ty.print(cx),
ty::TermKind::Const(c) => c.print(cx),
}?;
}
ty::ExistentialPredicate::AutoTrait(def_id) => {