Skip to content

Commit 3f7aeb3

Browse files
committed
make param bound vars visibly bound vars
1 parent 77d50a8 commit 3f7aeb3

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

compiler/rustc_middle/src/ty/print/pretty.rs

+5-1
Original file line numberDiff line numberDiff line change
@@ -704,7 +704,11 @@ pub trait PrettyPrinter<'tcx>:
704704
ty::BoundTyKind::Anon(bv) => {
705705
self.pretty_print_bound_var(debruijn, ty::BoundVar::from_u32(bv))?
706706
}
707-
ty::BoundTyKind::Param(_, s) => p!(write("{}", s)),
707+
ty::BoundTyKind::Param(_, s) => match self.should_print_verbose() {
708+
true if debruijn == ty::INNERMOST => p!(write("^{}", s)),
709+
true => p!(write("^{}_{}", debruijn.index(), s)),
710+
false => p!(write("{}", s)),
711+
},
708712
},
709713
ty::Adt(def, substs) => {
710714
p!(print_def_path(def.did(), substs));

0 commit comments

Comments
 (0)