@@ -805,29 +805,35 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
805
805
sess. time( "MIR_borrow_checking" , || {
806
806
tcx. hir( ) . par_body_owners( |def_id| tcx. ensure( ) . mir_borrowck( def_id) ) ;
807
807
} ) ;
808
+ } ,
809
+ {
810
+ sess. time( "MIR_effect_checking" , || {
811
+ for def_id in tcx. hir( ) . body_owners( ) {
812
+ tcx. ensure( ) . thir_check_unsafety( def_id) ;
813
+ if !tcx. sess. opts. unstable_opts. thir_unsafeck {
814
+ rustc_mir_transform:: check_unsafety:: check_unsafety( tcx, def_id) ;
815
+ }
816
+ tcx. ensure( ) . has_ffi_unwind_calls( def_id) ;
817
+
818
+ // If we need to codegen, ensure that we emit all errors from
819
+ // `mir_drops_elaborated_and_const_checked` now, to avoid discovering
820
+ // them later during codegen.
821
+ if tcx. sess. opts. output_types. should_codegen( )
822
+ || tcx. hir( ) . body_const_context( def_id) . is_some( )
823
+ {
824
+ tcx. ensure( ) . mir_drops_elaborated_and_const_checked( def_id) ;
825
+ tcx. ensure( )
826
+ . unused_generic_params( ty:: InstanceDef :: Item ( def_id. to_def_id( ) ) ) ;
827
+ }
828
+ }
829
+ } ) ;
830
+ } ,
831
+ {
832
+ sess. time( "layout_testing" , || layout_test:: test_layout( tcx) ) ;
833
+ sess. time( "abi_testing" , || abi_test:: test_abi( tcx) ) ;
808
834
}
809
835
) ;
810
836
811
- sess. time ( "MIR_effect_checking" , || {
812
- for def_id in tcx. hir ( ) . body_owners ( ) {
813
- tcx. ensure ( ) . thir_check_unsafety ( def_id) ;
814
- if !tcx. sess . opts . unstable_opts . thir_unsafeck {
815
- rustc_mir_transform:: check_unsafety:: check_unsafety ( tcx, def_id) ;
816
- }
817
- tcx. ensure ( ) . has_ffi_unwind_calls ( def_id) ;
818
-
819
- // If we need to codegen, ensure that we emit all errors from
820
- // `mir_drops_elaborated_and_const_checked` now, to avoid discovering
821
- // them later during codegen.
822
- if tcx. sess . opts . output_types . should_codegen ( )
823
- || tcx. hir ( ) . body_const_context ( def_id) . is_some ( )
824
- {
825
- tcx. ensure ( ) . mir_drops_elaborated_and_const_checked ( def_id) ;
826
- tcx. ensure ( ) . unused_generic_params ( ty:: InstanceDef :: Item ( def_id. to_def_id ( ) ) ) ;
827
- }
828
- }
829
- } ) ;
830
-
831
837
if tcx. sess . opts . unstable_opts . drop_tracking_mir {
832
838
tcx. hir ( ) . par_body_owners ( |def_id| {
833
839
if let rustc_hir:: def:: DefKind :: Generator = tcx. def_kind ( def_id) {
@@ -837,9 +843,6 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
837
843
} ) ;
838
844
}
839
845
840
- sess. time ( "layout_testing" , || layout_test:: test_layout ( tcx) ) ;
841
- sess. time ( "abi_testing" , || abi_test:: test_abi ( tcx) ) ;
842
-
843
846
// Avoid overwhelming user with errors if borrow checking failed.
844
847
// I'm not sure how helpful this is, to be honest, but it avoids a
845
848
// lot of annoying errors in the ui tests (basically,
0 commit comments