Add typed {Local}DefId for modules

This allows for better type safety in the compiler and also improves the
documentation for many things, making it clear that they expect modules.
This commit is contained in:
Nilstrieb 2023-04-26 20:53:05 +02:00 committed by Deadbeef
parent cb0c29978b
commit 40de40e094
4 changed files with 148 additions and 3 deletions

View file

@ -1448,7 +1448,7 @@ pub(super) fn check_mod_item_types(tcx: TyCtxt<'_>, module_def_id: LocalDefId) {
for id in module.items() {
check_item_type(tcx, id);
}
if module_def_id == CRATE_DEF_ID {
if module_def_id == LocalModDefId::CRATE_DEF_ID {
super::entry::check_for_entry_fn(tcx);
}
}