@@ -1222,26 +1222,28 @@ where
1222
1222
// tcx available.
1223
1223
time ( sess, "dep graph tcx init" , || rustc_incremental:: dep_graph_tcx_init ( tcx) ) ;
1224
1224
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
+ } ) ;
1238
1229
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
+ } ) ;
1242
1233
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
+ } ) ;
1245
1247
} ) ;
1246
1248
1247
1249
// passes are timed inside typeck
@@ -1253,27 +1255,31 @@ where
1253
1255
}
1254
1256
}
1255
1257
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
+ } ) ;
1266
1278
} ) ;
1267
1279
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 ( ) ;
1277
1283
1278
1284
time ( sess, "borrow checking" , || {
1279
1285
if tcx. use_ast_borrowck ( ) {
@@ -1297,7 +1303,7 @@ where
1297
1303
1298
1304
time ( sess, "layout testing" , || layout_test:: test_layout ( tcx) ) ;
1299
1305
1300
- // Avoid overwhelming user with errors if type checking failed.
1306
+ // Avoid overwhelming user with errors if borrow checking failed.
1301
1307
// I'm not sure how helpful this is, to be honest, but it avoids
1302
1308
// a
1303
1309
// lot of annoying errors in the compile-fail tests (basically,
@@ -1307,14 +1313,22 @@ where
1307
1313
return Ok ( f ( tcx, rx, sess. compile_status ( ) ) ) ;
1308
1314
}
1309
1315
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
+ } ) ;
1314
1330
} ) ;
1315
1331
1316
- time ( sess, "lint checking" , || lint:: check_crate ( tcx) ) ;
1317
-
1318
1332
return Ok ( f ( tcx, rx, tcx. sess . compile_status ( ) ) ) ;
1319
1333
} ,
1320
1334
)
0 commit comments