@@ -2806,13 +2806,16 @@ fn pretty_print_byte_str(fmt: &mut Formatter<'_>, byte_str: &[u8]) -> fmt::Resul
28062806 write ! ( fmt, "b\" {}\" " , byte_str. escape_ascii( ) )
28072807}
28082808
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 {
28102813 let mut first = true ;
2811- for elem in elems {
2814+ for ( ct , ty ) in elems {
28122815 if !first {
28132816 fmt. write_str ( ", " ) ?;
28142817 }
2815- fmt . write_str ( & format ! ( "{}" , elem ) ) ?;
2818+ pretty_print_const_value ( ct , ty , fmt , true ) ?;
28162819 first = false ;
28172820 }
28182821 Ok ( ( ) )
@@ -2925,12 +2928,14 @@ fn pretty_print_const_value<'tcx>(
29252928 None => {
29262929 fmt. write_str ( " {{ " ) ?;
29272930 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)
29292933 {
29302934 if !first {
29312935 fmt. write_str ( ", " ) ?;
29322936 }
2933- fmt. write_str ( & format ! ( "{}: {}" , field_def. name, field) ) ?;
2937+ write ! ( fmt, "{}: " , field_def. name) ?;
2938+ pretty_print_const_value ( ct, ty, fmt, true ) ?;
29342939 first = false ;
29352940 }
29362941 fmt. write_str ( " }}" ) ?;
0 commit comments