@@ -2806,13 +2806,16 @@ fn pretty_print_byte_str(fmt: &mut Formatter<'_>, byte_str: &[u8]) -> fmt::Resul
2806
2806
write ! ( fmt, "b\" {}\" " , byte_str. escape_ascii( ) )
2807
2807
}
2808
2808
2809
- fn comma_sep < ' tcx > ( fmt : & mut Formatter < ' _ > , elems : Vec < ConstantKind < ' tcx > > ) -> fmt:: Result {
2809
+ fn comma_sep < ' tcx > (
2810
+ fmt : & mut Formatter < ' _ > ,
2811
+ elems : Vec < ( ConstValue < ' tcx > , Ty < ' tcx > ) > ,
2812
+ ) -> fmt:: Result {
2810
2813
let mut first = true ;
2811
- for elem in elems {
2814
+ for ( ct , ty ) in elems {
2812
2815
if !first {
2813
2816
fmt. write_str ( ", " ) ?;
2814
2817
}
2815
- fmt . write_str ( & format ! ( "{}" , elem ) ) ?;
2818
+ pretty_print_const_value ( ct , ty , fmt , true ) ?;
2816
2819
first = false ;
2817
2820
}
2818
2821
Ok ( ( ) )
@@ -2925,12 +2928,14 @@ fn pretty_print_const_value<'tcx>(
2925
2928
None => {
2926
2929
fmt. write_str ( " {{ " ) ?;
2927
2930
let mut first = true ;
2928
- for ( field_def, field) in iter:: zip ( & variant_def. fields , fields)
2931
+ for ( field_def, ( ct, ty) ) in
2932
+ iter:: zip ( & variant_def. fields , fields)
2929
2933
{
2930
2934
if !first {
2931
2935
fmt. write_str ( ", " ) ?;
2932
2936
}
2933
- fmt. write_str ( & format ! ( "{}: {}" , field_def. name, field) ) ?;
2937
+ write ! ( fmt, "{}: " , field_def. name) ?;
2938
+ pretty_print_const_value ( ct, ty, fmt, true ) ?;
2934
2939
first = false ;
2935
2940
}
2936
2941
fmt. write_str ( " }}" ) ?;
0 commit comments