Skip to content

Commit b80fe0f

Browse files
committed
Tweak misc checking 1
1 parent 6523c67 commit b80fe0f

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

compiler/rustc_interface/src/passes.rs

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -756,14 +756,28 @@ fn analysis(tcx: TyCtxt<'_>, (): ()) -> Result<()> {
756756
CStore::from_tcx(tcx).report_unused_deps(tcx);
757757
},
758758
{
759+
// Prefetch this as it is used later by the loop below
760+
// to prevent multiple threads from blocking on it.
761+
tcx.ensure_with_value().get_lang_items(());
762+
763+
let _timer = tcx.sess.timer("misc_module_passes");
759764
tcx.hir().par_for_each_module(|module| {
760765
tcx.ensure().check_mod_loops(module);
761766
tcx.ensure().check_mod_attrs(module);
762767
tcx.ensure().check_mod_naked_functions(module);
763-
tcx.ensure().check_mod_unstable_api_usage(module);
764768
tcx.ensure().check_mod_const_bodies(module);
765769
});
766770
},
771+
{
772+
// Prefetch this as it is used later by the loop below
773+
// to prevent multiple threads from blocking on it.
774+
tcx.ensure_with_value().stability_index(());
775+
776+
let _timer = tcx.sess.timer("check_unstable_api_usage");
777+
tcx.hir().par_for_each_module(|module| {
778+
tcx.ensure().check_mod_unstable_api_usage(module);
779+
});
780+
},
767781
{
768782
sess.time("unused_lib_feature_checking", || {
769783
rustc_passes::stability::check_unused_or_stable_features(tcx)

0 commit comments

Comments
 (0)