@@ -1176,25 +1176,27 @@ impl<'a, 'tcx> LayoutCx<'tcx, TyCtxt<'a, 'tcx, 'tcx>> {
1176
1176
1177
1177
/// This is invoked by the `layout_raw` query to record the final
1178
1178
/// layout of each type.
1179
- #[ inline]
1179
+ #[ inline( always ) ]
1180
1180
fn record_layout_for_printing ( & self , layout : TyLayout < ' tcx > ) {
1181
- // If we are running with `-Zprint-type-sizes`, record layouts for
1182
- // dumping later. Ignore layouts that are done with non-empty
1183
- // environments or non-monomorphic layouts, as the user only wants
1184
- // to see the stuff resulting from the final codegen session.
1181
+ // If we are running with `-Zprint-type-sizes`, maybe record layouts
1182
+ // for dumping later.
1183
+ if self . tcx . sess . opts . debugging_opts . print_type_sizes {
1184
+ self . record_layout_for_printing_outlined ( layout)
1185
+ }
1186
+ }
1187
+
1188
+ fn record_layout_for_printing_outlined ( & self , layout : TyLayout < ' tcx > ) {
1189
+ // Ignore layouts that are done with non-empty environments or
1190
+ // non-monomorphic layouts, as the user only wants to see the stuff
1191
+ // resulting from the final codegen session.
1185
1192
if
1186
- !self . tcx . sess . opts . debugging_opts . print_type_sizes ||
1187
1193
layout. ty . has_param_types ( ) ||
1188
1194
layout. ty . has_self_ty ( ) ||
1189
1195
!self . param_env . caller_bounds . is_empty ( )
1190
1196
{
1191
1197
return ;
1192
1198
}
1193
1199
1194
- self . record_layout_for_printing_outlined ( layout)
1195
- }
1196
-
1197
- fn record_layout_for_printing_outlined ( & self , layout : TyLayout < ' tcx > ) {
1198
1200
// (delay format until we actually need it)
1199
1201
let record = |kind, packed, opt_discr_size, variants| {
1200
1202
let type_desc = format ! ( "{:?}" , layout. ty) ;
0 commit comments