1
Fork 0

Pretty-print own args of existential projections

This commit is contained in:
León Orell Valerian Liehr 2024-08-22 05:30:08 +02:00
parent c416a6fc73
commit 080c2ca2dc
No known key found for this signature in database
GPG key ID: D17A07215F68E713
7 changed files with 50 additions and 20 deletions

View file

@ -3119,7 +3119,10 @@ define_print! {
ty::ExistentialProjection<'tcx> {
let name = cx.tcx().associated_item(self.def_id).name;
p!(write("{} = ", name), print(self.term))
// The args don't contain the self ty (as it has been erased) but the corresp.
// generics do as the trait always has a self ty param. We need to offset.
let args = &self.args[cx.tcx().generics_of(self.def_id).parent_count - 1..];
p!(path_generic_args(|cx| write!(cx, "{name}"), args), " = ", print(self.term))
}
ty::ProjectionPredicate<'tcx> {