Skip to content

Commit 6cbc6c3

Browse files
committed
Auto merge of rust-lang#94279 - tmiasko:write-print, r=Mark-Simulacrum
Print `ParamTy` and `ParamConst` instead of displaying them Display for `ParamTy` and `ParamConst` is implemented in terms of print. Using print avoids creating a new `FmtPrinter` just to display the parameter name. r? `@Mark-Simulacrum`
2 parents 9f8f0a6 + eaf4c91 commit 6cbc6c3

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

+2-2
Original file line numberDiff line numberDiff line change
@@ -612,7 +612,7 @@ pub trait PrettyPrinter<'tcx>:
612612
}
613613
}
614614
ty::Error(_) => p!("[type error]"),
615-
ty::Param(ref param_ty) => p!(write("{}", param_ty)),
615+
ty::Param(ref param_ty) => p!(print(param_ty)),
616616
ty::Bound(debruijn, bound_ty) => match bound_ty.kind {
617617
ty::BoundTyKind::Anon => self.pretty_print_bound_var(debruijn, bound_ty.var)?,
618618
ty::BoundTyKind::Param(p) => p!(write("{}", p)),
@@ -754,7 +754,7 @@ pub trait PrettyPrinter<'tcx>:
754754
} else if let Some(n) = sz.val().try_to_bits(self.tcx().data_layout.pointer_size) {
755755
p!(write("{}", n));
756756
} else if let ty::ConstKind::Param(param) = sz.val() {
757-
p!(write("{}", param));
757+
p!(print(param));
758758
} else {
759759
p!("_");
760760
}

0 commit comments

Comments
 (0)