about summary refs log tree commit diff
path: root/compiler/rustc_middle/src/ty/print
diff options
context:
space:
mode:
authorMichael Goulet <michael@errs.io>2023-02-17 21:21:27 +0000
committerMichael Goulet <michael@errs.io>2023-02-18 19:49:40 +0000
commit6f3706ea71a89a431acf7f84573b87c2ac98b0c7 (patch)
treef368516dae7ea14d2f5a75fa30e57bbbc679bd87 /compiler/rustc_middle/src/ty/print
parentec40b1a3938ea0f7ae27b4bffe62bd41dc8015af (diff)
downloadrust-6f3706ea71a89a431acf7f84573b87c2ac98b0c7.tar.gz
rust-6f3706ea71a89a431acf7f84573b87c2ac98b0c7.zip
Pretty placeholders using their names
Diffstat (limited to 'compiler/rustc_middle/src/ty/print')
-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 1e59983583b..a101127104d 100644
--- a/compiler/rustc_middle/src/ty/print/pretty.rs
+++ b/compiler/rustc_middle/src/ty/print/pretty.rs
@@ -735,7 +735,10 @@ pub trait PrettyPrinter<'tcx>:
                     p!(print(data))
                 }
             }
-            ty::Placeholder(placeholder) => p!(write("Placeholder({:?})", placeholder)),
+            ty::Placeholder(placeholder) => match placeholder.name {
+                ty::BoundTyKind::Anon(_) => p!(write("Placeholder({:?})", placeholder)),
+                ty::BoundTyKind::Param(_, name) => p!(write("{}", name)),
+            },
             ty::Alias(ty::Opaque, ty::AliasTy { def_id, substs, .. }) => {
                 // We use verbose printing in 'NO_QUERIES' mode, to
                 // avoid needing to call `predicates_of`. This should