This repository was archived by the owner on May 28, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +17
-4
lines changed
compiler/rustc_const_eval/src/interpret Expand file tree Collapse file tree 2 files changed +17
-4
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,11 @@ impl<Prov: Provenance> std::fmt::Display for ImmTy<'_, Prov> {
136136
137137impl < Prov : Provenance > std:: fmt:: Debug for ImmTy < ' _ , Prov > {
138138 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
139- f. debug_struct ( "ImmTy" ) . field ( "imm" , & self . imm ) . field ( "ty" , & self . layout . ty ) . finish ( )
139+ // Printing `layout` results in too much noise; just print a nice version of the type.
140+ f. debug_struct ( "ImmTy" )
141+ . field ( "imm" , & self . imm )
142+ . field ( "ty" , & format_args ! ( "{}" , self . layout. ty) )
143+ . finish ( )
140144 }
141145}
142146
@@ -305,7 +309,11 @@ pub struct OpTy<'tcx, Prov: Provenance = AllocId> {
305309
306310impl < Prov : Provenance > std:: fmt:: Debug for OpTy < ' _ , Prov > {
307311 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
308- f. debug_struct ( "OpTy" ) . field ( "op" , & self . op ) . field ( "ty" , & self . layout . ty ) . finish ( )
312+ // Printing `layout` results in too much noise; just print a nice version of the type.
313+ f. debug_struct ( "OpTy" )
314+ . field ( "op" , & self . op )
315+ . field ( "ty" , & format_args ! ( "{}" , self . layout. ty) )
316+ . finish ( )
309317 }
310318}
311319
Original file line number Diff line number Diff line change @@ -117,9 +117,10 @@ pub struct MPlaceTy<'tcx, Prov: Provenance = AllocId> {
117117
118118impl < Prov : Provenance > std:: fmt:: Debug for MPlaceTy < ' _ , Prov > {
119119 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
120+ // Printing `layout` results in too much noise; just print a nice version of the type.
120121 f. debug_struct ( "MPlaceTy" )
121122 . field ( "mplace" , & self . mplace )
122- . field ( "ty" , & self . layout . ty )
123+ . field ( "ty" , & format_args ! ( "{}" , self . layout. ty) )
123124 . finish ( )
124125 }
125126}
@@ -237,7 +238,11 @@ pub struct PlaceTy<'tcx, Prov: Provenance = AllocId> {
237238
238239impl < Prov : Provenance > std:: fmt:: Debug for PlaceTy < ' _ , Prov > {
239240 fn fmt ( & self , f : & mut std:: fmt:: Formatter < ' _ > ) -> std:: fmt:: Result {
240- f. debug_struct ( "PlaceTy" ) . field ( "place" , & self . place ) . field ( "ty" , & self . layout . ty ) . finish ( )
241+ // Printing `layout` results in too much noise; just print a nice version of the type.
242+ f. debug_struct ( "PlaceTy" )
243+ . field ( "place" , & self . place )
244+ . field ( "ty" , & format_args ! ( "{}" , self . layout. ty) )
245+ . finish ( )
241246 }
242247}
243248
You can’t perform that action at this time.
0 commit comments