Skip to content

Commit a3bd5a0

Browse files
committed
Inline and remove record_layout_for_printing.
It has a single call site.
1 parent e2664eb commit a3bd5a0

File tree

1 file changed

+5
-15
lines changed

1 file changed

+5
-15
lines changed

compiler/rustc_ty_utils/src/layout.rs

+5-15
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,11 @@ fn layout_of<'tcx>(
6565
let layout = layout_of_uncached(&cx, ty)?;
6666
let layout = TyAndLayout { ty, layout };
6767

68-
record_layout_for_printing(&cx, layout);
68+
// If we are running with `-Zprint-type-sizes`, maybe record layouts
69+
// for dumping later.
70+
if cx.tcx.sess.opts.unstable_opts.print_type_sizes {
71+
record_layout_for_printing(&cx, layout);
72+
}
6973

7074
sanity_check_layout(&cx, &layout);
7175

@@ -911,21 +915,7 @@ fn coroutine_layout<'tcx>(
911915
Ok(layout)
912916
}
913917

914-
/// This is invoked by the `layout_of` query to record the final
915-
/// layout of each type.
916-
#[inline(always)]
917918
fn record_layout_for_printing<'tcx>(cx: &LayoutCx<'tcx, TyCtxt<'tcx>>, layout: TyAndLayout<'tcx>) {
918-
// If we are running with `-Zprint-type-sizes`, maybe record layouts
919-
// for dumping later.
920-
if cx.tcx.sess.opts.unstable_opts.print_type_sizes {
921-
record_layout_for_printing_outlined(cx, layout)
922-
}
923-
}
924-
925-
fn record_layout_for_printing_outlined<'tcx>(
926-
cx: &LayoutCx<'tcx, TyCtxt<'tcx>>,
927-
layout: TyAndLayout<'tcx>,
928-
) {
929919
// Ignore layouts that are done with non-empty environments or
930920
// non-monomorphic layouts, as the user only wants to see the stuff
931921
// resulting from the final codegen session.

0 commit comments

Comments
 (0)