Remove some cruft from foreign_modules refactor

This commit is contained in:
Ryan Levick 2020-10-27 20:17:48 +01:00
parent 69dc98161a
commit 81444b2049
2 changed files with 4 additions and 5 deletions

View File

@ -860,8 +860,6 @@ pub fn provide_both(providers: &mut Providers) {
providers.dllimport_foreign_items = |tcx, krate| {
let module_map = tcx.foreign_modules(krate);
let module_map =
module_map.iter().map(|(def_id, lib)| (def_id, lib)).collect::<FxHashMap<_, _>>();
let dllimports = tcx
.native_libraries(krate)

View File

@ -270,9 +270,10 @@ pub fn provide(providers: &mut Providers) {
None => return false,
};
let map = tcx.foreign_modules(id.krate);
let module =
tcx.prof.generic_activity("finding_foreign_module").run(|| map.get(&fm_id));
module.expect("failed to find foreign module").foreign_items.contains(&id)
map.get(&fm_id)
.expect("failed to find foreign module")
.foreign_items
.contains(&id)
})
.map(|l| l.kind)
},