File tree 2 files changed +17
-4
lines changed
compiler/rustc_const_eval/src/interpret
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> {
136
136
137
137
impl < Prov : Provenance > std:: fmt:: Debug for ImmTy < ' _ , Prov > {
138
138
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 ( )
140
144
}
141
145
}
142
146
@@ -305,7 +309,11 @@ pub struct OpTy<'tcx, Prov: Provenance = AllocId> {
305
309
306
310
impl < Prov : Provenance > std:: fmt:: Debug for OpTy < ' _ , Prov > {
307
311
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 ( )
309
317
}
310
318
}
311
319
Original file line number Diff line number Diff line change @@ -117,9 +117,10 @@ pub struct MPlaceTy<'tcx, Prov: Provenance = AllocId> {
117
117
118
118
impl < Prov : Provenance > std:: fmt:: Debug for MPlaceTy < ' _ , Prov > {
119
119
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.
120
121
f. debug_struct ( "MPlaceTy" )
121
122
. field ( "mplace" , & self . mplace )
122
- . field ( "ty" , & self . layout . ty )
123
+ . field ( "ty" , & format_args ! ( "{}" , self . layout. ty) )
123
124
. finish ( )
124
125
}
125
126
}
@@ -237,7 +238,11 @@ pub struct PlaceTy<'tcx, Prov: Provenance = AllocId> {
237
238
238
239
impl < Prov : Provenance > std:: fmt:: Debug for PlaceTy < ' _ , Prov > {
239
240
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 ( )
241
246
}
242
247
}
243
248
You can’t perform that action at this time.
0 commit comments