about summary refs log tree commit diff
path: root/compiler
diff options
context:
space:
mode:
authorLeón Orell Valerian Liehr <me@fmease.dev>2024-08-22 05:30:08 +0200
committerLeón Orell Valerian Liehr <me@fmease.dev>2024-08-22 06:22:36 +0200
commit080c2ca2dcdf38f9337f0aedaa166ec6fbebd681 (patch)
tree04dc8878754da2ede42cd6e761d21d195c45a50a /compiler
parentc416a6fc73657648b81670e5feadf5c7810aa31d (diff)
downloadrust-080c2ca2dcdf38f9337f0aedaa166ec6fbebd681.tar.gz
rust-080c2ca2dcdf38f9337f0aedaa166ec6fbebd681.zip
Pretty-print own args of existential projections
Diffstat (limited to 'compiler')
-rw-r--r--compiler/rustc_middle/src/ty/print/pretty.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/compiler/rustc_middle/src/ty/print/pretty.rs b/compiler/rustc_middle/src/ty/print/pretty.rs
index 56ddf146636..cd80cc4d1ab 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -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> {