@@ -24,7 +24,7 @@ use crate::errors::{
24
24
} ;
25
25
use crate :: layout_sanity_check:: sanity_check_layout;
26
26
27
- pub fn provide ( providers : & mut Providers ) {
27
+ pub ( crate ) fn provide ( providers : & mut Providers ) {
28
28
* providers = Providers { layout_of, ..* providers } ;
29
29
}
30
30
@@ -65,7 +65,11 @@ fn layout_of<'tcx>(
65
65
let layout = layout_of_uncached ( & cx, ty) ?;
66
66
let layout = TyAndLayout { ty, layout } ;
67
67
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
+ }
69
73
70
74
sanity_check_layout ( & cx, & layout) ;
71
75
@@ -911,21 +915,7 @@ fn coroutine_layout<'tcx>(
911
915
Ok ( layout)
912
916
}
913
917
914
- /// This is invoked by the `layout_of` query to record the final
915
- /// layout of each type.
916
- #[ inline( always) ]
917
918
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
- ) {
929
919
// Ignore layouts that are done with non-empty environments or
930
920
// non-monomorphic layouts, as the user only wants to see the stuff
931
921
// resulting from the final codegen session.
0 commit comments