Skip to content

Commit 140a837

Browse files
committed
Make misc checking 1 more parallel
1 parent 1745957 commit 140a837

File tree

4 files changed

+17
-37
lines changed

4 files changed

+17
-37
lines changed

src/librustc/hir/check_attr.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -344,12 +344,6 @@ impl<'a, 'tcx> Visitor<'tcx> for CheckAttrVisitor<'a, 'tcx> {
344344
}
345345
}
346346

347-
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
348-
for &module in tcx.hir().krate().modules.keys() {
349-
tcx.ensure().check_mod_attrs(tcx.hir().local_def_id(module));
350-
}
351-
}
352-
353347
fn is_c_like_enum(item: &hir::Item) -> bool {
354348
if let hir::ItemKind::Enum(ref def, _) = item.node {
355349
for variant in &def.variants {

src/librustc/middle/stability.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -456,12 +456,6 @@ impl<'a, 'tcx> Index<'tcx> {
456456
}
457457
}
458458

459-
pub fn check_unstable_api_usage<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
460-
for &module in tcx.hir().krate().modules.keys() {
461-
tcx.ensure().check_mod_unstable_api_usage(tcx.hir().local_def_id(module));
462-
}
463-
}
464-
465459
/// Cross-references the feature names of unstable APIs with enabled
466460
/// features and possibly prints errors.
467461
fn check_mod_unstable_api_usage<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>, module_def_id: DefId) {

src/librustc_interface/passes.rs

Lines changed: 17 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -191,27 +191,25 @@ fn analysis<'tcx>(
191191

192192
let sess = tcx.sess;
193193

194-
parallel!({
195-
time(sess, "looking for entry point", || {
196-
middle::entry::find_entry_point(tcx)
197-
});
194+
time(sess, "misc checking 1", || {
195+
parallel!({
196+
time(sess, "looking for entry point", || {
197+
middle::entry::find_entry_point(tcx)
198+
});
198199

199-
time(sess, "looking for plugin registrar", || {
200-
plugin::build::find_plugin_registrar(tcx)
201-
});
200+
time(sess, "looking for plugin registrar", || {
201+
plugin::build::find_plugin_registrar(tcx)
202+
});
202203

203-
time(sess, "looking for derive registrar", || {
204-
proc_macro_decls::find(tcx)
205-
});
206-
}, {
207-
time(sess, "loop checking", || loops::check_crate(tcx));
208-
}, {
209-
time(sess, "attribute checking", || {
210-
hir::check_attr::check_crate(tcx)
211-
});
212-
}, {
213-
time(sess, "stability checking", || {
214-
stability::check_unstable_api_usage(tcx)
204+
time(sess, "looking for derive registrar", || {
205+
proc_macro_decls::find(tcx)
206+
});
207+
}, {
208+
par_iter(&tcx.hir().krate().modules).for_each(|(&module, _)| {
209+
tcx.ensure().check_mod_loops(tcx.hir().local_def_id(module));
210+
tcx.ensure().check_mod_attrs(tcx.hir().local_def_id(module));
211+
tcx.ensure().check_mod_unstable_api_usage(tcx.hir().local_def_id(module));
212+
});
215213
});
216214
});
217215

src/librustc_passes/loops.rs

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,12 +46,6 @@ struct CheckLoopVisitor<'a, 'hir: 'a> {
4646
cx: Context,
4747
}
4848

49-
pub fn check_crate<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>) {
50-
for &module in tcx.hir().krate().modules.keys() {
51-
tcx.ensure().check_mod_loops(tcx.hir().local_def_id(module));
52-
}
53-
}
54-
5549
fn check_mod_loops<'tcx>(tcx: TyCtxt<'_, 'tcx, 'tcx>, module_def_id: DefId) {
5650
tcx.hir().visit_item_likes_in_module(module_def_id, &mut CheckLoopVisitor {
5751
sess: &tcx.sess,

0 commit comments

Comments
 (0)