Index Modules using their LocalDefId.
This commit is contained in:
parent
7878fa70d6
commit
ff14cac621
10 changed files with 27 additions and 38 deletions
|
@ -831,12 +831,11 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
|
|||
},
|
||||
{
|
||||
par_iter(&tcx.hir().krate().modules).for_each(|(&module, _)| {
|
||||
let local_def_id = tcx.hir().local_def_id(module);
|
||||
tcx.ensure().check_mod_loops(local_def_id);
|
||||
tcx.ensure().check_mod_attrs(local_def_id);
|
||||
tcx.ensure().check_mod_naked_functions(local_def_id);
|
||||
tcx.ensure().check_mod_unstable_api_usage(local_def_id);
|
||||
tcx.ensure().check_mod_const_bodies(local_def_id);
|
||||
tcx.ensure().check_mod_loops(module);
|
||||
tcx.ensure().check_mod_attrs(module);
|
||||
tcx.ensure().check_mod_naked_functions(module);
|
||||
tcx.ensure().check_mod_unstable_api_usage(module);
|
||||
tcx.ensure().check_mod_const_bodies(module);
|
||||
});
|
||||
}
|
||||
);
|
||||
|
@ -861,10 +860,8 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
|
|||
// "not all control paths return a value" is reported here.
|
||||
//
|
||||
// maybe move the check to a MIR pass?
|
||||
let local_def_id = tcx.hir().local_def_id(module);
|
||||
|
||||
tcx.ensure().check_mod_liveness(local_def_id);
|
||||
tcx.ensure().check_mod_intrinsics(local_def_id);
|
||||
tcx.ensure().check_mod_liveness(module);
|
||||
tcx.ensure().check_mod_intrinsics(module);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
@ -926,7 +923,7 @@ fn analysis(tcx: TyCtxt<'_>, cnum: CrateNum) -> Result<()> {
|
|||
{
|
||||
sess.time("privacy_checking_modules", || {
|
||||
par_iter(&tcx.hir().krate().modules).for_each(|(&module, _)| {
|
||||
tcx.ensure().check_mod_privacy(tcx.hir().local_def_id(module));
|
||||
tcx.ensure().check_mod_privacy(module);
|
||||
});
|
||||
});
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue