Skip to content

Commit

Permalink
make param bound vars visibly bound vars
Browse files Browse the repository at this point in the history
  • Loading branch information
BoxyUwU committed Mar 23, 2023
1 parent 77d50a8 commit 3f7aeb3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion compiler/rustc_middle/src/ty/print/pretty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -704,7 +704,11 @@ pub trait PrettyPrinter<'tcx>:
ty::BoundTyKind::Anon(bv) => {
self.pretty_print_bound_var(debruijn, ty::BoundVar::from_u32(bv))?
}
ty::BoundTyKind::Param(_, s) => p!(write("{}", s)),
ty::BoundTyKind::Param(_, s) => match self.should_print_verbose() {
true if debruijn == ty::INNERMOST => p!(write("^{}", s)),
true => p!(write("^{}_{}", debruijn.index(), s)),
false => p!(write("{}", s)),
},
},
ty::Adt(def, substs) => {
p!(print_def_path(def.did(), substs));
Expand Down

0 comments on commit 3f7aeb3

Please sign in to comment.