Skip to content

Commit

Permalink
Remove some cruft from foreign_modules refactor
Browse files Browse the repository at this point in the history
  • Loading branch information
rylev committed Oct 27, 2020
1 parent 69dc981 commit 81444b2
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 5 deletions.
2 changes: 0 additions & 2 deletions compiler/rustc_codegen_ssa/src/base.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
7 changes: 4 additions & 3 deletions compiler/rustc_metadata/src/rmeta/decoder/cstore_impl.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
},
Expand Down

0 comments on commit 81444b2

Please sign in to comment.