@@ -913,10 +913,10 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
913913 } ) ;
914914 } , {
915915 par_iter( & tcx. hir( ) . krate( ) . modules) . for_each( |( & module, _) | {
916- tcx. ensure ( ) . check_mod_loops ( tcx . hir( ) . local_def_id_from_node_id ( module) ) ;
917- tcx. ensure( ) . check_mod_attrs ( tcx . hir ( ) . local_def_id_from_node_id ( module ) ) ;
918- tcx. ensure( ) . check_mod_unstable_api_usage (
919- tcx. hir ( ) . local_def_id_from_node_id ( module ) ) ;
916+ let local_def_id = tcx. hir( ) . local_def_id ( module) ;
917+ tcx. ensure( ) . check_mod_loops ( local_def_id ) ;
918+ tcx. ensure( ) . check_mod_attrs ( local_def_id ) ;
919+ tcx. ensure ( ) . check_mod_unstable_api_usage ( local_def_id ) ;
920920 } ) ;
921921 } ) ;
922922 } ) ;
@@ -939,9 +939,10 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
939939 // "not all control paths return a value" is reported here.
940940 //
941941 // maybe move the check to a MIR pass?
942- tcx. ensure ( ) . check_mod_liveness ( tcx . hir( ) . local_def_id_from_node_id ( module) ) ;
942+ let local_def_id = tcx. hir( ) . local_def_id ( module) ;
943943
944- tcx. ensure( ) . check_mod_intrinsics( tcx. hir( ) . local_def_id_from_node_id( module) ) ;
944+ tcx. ensure( ) . check_mod_liveness( local_def_id) ;
945+ tcx. ensure( ) . check_mod_intrinsics( local_def_id) ;
945946 } ) ;
946947 } ) ;
947948 } ) ;
@@ -1001,7 +1002,7 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
10011002 } , {
10021003 time( sess, "privacy checking modules" , || {
10031004 par_iter( & tcx. hir( ) . krate( ) . modules) . for_each( |( & module, _) | {
1004- tcx. ensure( ) . check_mod_privacy( tcx. hir( ) . local_def_id_from_node_id ( module) ) ;
1005+ tcx. ensure( ) . check_mod_privacy( tcx. hir( ) . local_def_id ( module) ) ;
10051006 } ) ;
10061007 } ) ;
10071008 } ) ;
0 commit comments