@@ -1222,26 +1222,28 @@ where
12221222 // tcx available.
12231223 time ( sess, "dep graph tcx init" , || rustc_incremental:: dep_graph_tcx_init ( tcx) ) ;
12241224
1225- time ( sess, "looking for entry point" , || {
1226- middle:: entry:: find_entry_point ( tcx)
1227- } ) ;
1228-
1229- time ( sess, "looking for plugin registrar" , || {
1230- plugin:: build:: find_plugin_registrar ( tcx)
1231- } ) ;
1232-
1233- time ( sess, "looking for derive registrar" , || {
1234- proc_macro_decls:: find ( tcx)
1235- } ) ;
1236-
1237- time ( sess, "loop checking" , || loops:: check_crate ( tcx) ) ;
1225+ parallel ! ( {
1226+ time( sess, "looking for entry point" , || {
1227+ middle:: entry:: find_entry_point( tcx)
1228+ } ) ;
12381229
1239- time ( sess, "attribute checking " , || {
1240- hir :: check_attr :: check_crate ( tcx)
1241- } ) ;
1230+ time( sess, "looking for plugin registrar " , || {
1231+ plugin :: build :: find_plugin_registrar ( tcx)
1232+ } ) ;
12421233
1243- time ( sess, "stability checking" , || {
1244- stability:: check_unstable_api_usage ( tcx)
1234+ time( sess, "looking for derive registrar" , || {
1235+ proc_macro_decls:: find( tcx)
1236+ } ) ;
1237+ } , {
1238+ time( sess, "loop checking" , || loops:: check_crate( tcx) ) ;
1239+ } , {
1240+ time( sess, "attribute checking" , || {
1241+ hir:: check_attr:: check_crate( tcx)
1242+ } ) ;
1243+ } , {
1244+ time( sess, "stability checking" , || {
1245+ stability:: check_unstable_api_usage( tcx)
1246+ } ) ;
12451247 } ) ;
12461248
12471249 // passes are timed inside typeck
@@ -1253,27 +1255,31 @@ where
12531255 }
12541256 }
12551257
1256- time ( sess, "rvalue promotion" , || {
1257- rvalue_promotion:: check_crate ( tcx)
1258- } ) ;
1259-
1260- time ( sess, "privacy checking" , || {
1261- rustc_privacy:: check_crate ( tcx)
1262- } ) ;
1263-
1264- time ( sess, "intrinsic checking" , || {
1265- middle:: intrinsicck:: check_crate ( tcx)
1258+ time ( sess, "misc checking" , || {
1259+ parallel ! ( {
1260+ time( sess, "rvalue promotion" , || {
1261+ rvalue_promotion:: check_crate( tcx)
1262+ } ) ;
1263+ } , {
1264+ time( sess, "intrinsic checking" , || {
1265+ middle:: intrinsicck:: check_crate( tcx)
1266+ } ) ;
1267+ } , {
1268+ time( sess, "match checking" , || mir:: matchck_crate( tcx) ) ;
1269+ } , {
1270+ // this must run before MIR dump, because
1271+ // "not all control paths return a value" is reported here.
1272+ //
1273+ // maybe move the check to a MIR pass?
1274+ time( sess, "liveness checking" , || {
1275+ middle:: liveness:: check_crate( tcx)
1276+ } ) ;
1277+ } ) ;
12661278 } ) ;
12671279
1268- time ( sess, "match checking" , || mir:: matchck_crate ( tcx) ) ;
1269-
1270- // this must run before MIR dump, because
1271- // "not all control paths return a value" is reported here.
1272- //
1273- // maybe move the check to a MIR pass?
1274- time ( sess, "liveness checking" , || {
1275- middle:: liveness:: check_crate ( tcx)
1276- } ) ;
1280+ // Abort so we don't try to construct MIR with liveness errors.
1281+ // We also won't want to continue with errors from rvalue promotion
1282+ tcx. sess . abort_if_errors ( ) ;
12771283
12781284 time ( sess, "borrow checking" , || {
12791285 if tcx. use_ast_borrowck ( ) {
@@ -1297,7 +1303,7 @@ where
12971303
12981304 time ( sess, "layout testing" , || layout_test:: test_layout ( tcx) ) ;
12991305
1300- // Avoid overwhelming user with errors if type checking failed.
1306+ // Avoid overwhelming user with errors if borrow checking failed.
13011307 // I'm not sure how helpful this is, to be honest, but it avoids
13021308 // a
13031309 // lot of annoying errors in the compile-fail tests (basically,
@@ -1307,14 +1313,22 @@ where
13071313 return Ok ( f ( tcx, rx, sess. compile_status ( ) ) ) ;
13081314 }
13091315
1310- time ( sess, "death checking" , || middle:: dead:: check_crate ( tcx) ) ;
1311-
1312- time ( sess, "unused lib feature checking" , || {
1313- stability:: check_unused_or_stable_features ( tcx)
1316+ time ( sess, "misc checking" , || {
1317+ parallel ! ( {
1318+ time( sess, "privacy checking" , || {
1319+ rustc_privacy:: check_crate( tcx)
1320+ } ) ;
1321+ } , {
1322+ time( sess, "death checking" , || middle:: dead:: check_crate( tcx) ) ;
1323+ } , {
1324+ time( sess, "unused lib feature checking" , || {
1325+ stability:: check_unused_or_stable_features( tcx)
1326+ } ) ;
1327+ } , {
1328+ time( sess, "lint checking" , || lint:: check_crate( tcx) ) ;
1329+ } ) ;
13141330 } ) ;
13151331
1316- time ( sess, "lint checking" , || lint:: check_crate ( tcx) ) ;
1317-
13181332 return Ok ( f ( tcx, rx, tcx. sess . compile_status ( ) ) ) ;
13191333 } ,
13201334 )
0 commit comments