@@ -24,7 +24,7 @@ use crate::errors::{
2424} ;
2525use crate :: layout_sanity_check:: sanity_check_layout;
2626
27- pub fn provide ( providers : & mut Providers ) {
27+ pub ( crate ) fn provide ( providers : & mut Providers ) {
2828 * providers = Providers { layout_of, ..* providers } ;
2929}
3030
@@ -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) ]
917918fn 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