1
Fork 0

Use () in dependency_formats.

This commit is contained in:
Camille GILLOT 2021-05-11 11:26:52 +02:00
parent ac923d94f8
commit 85a14d70bb
8 changed files with 18 additions and 13 deletions

View file

@ -1303,7 +1303,7 @@ fn exported_symbols(tcx: TyCtxt<'_>, crate_type: CrateType) -> Vec<String> {
}
}
let formats = tcx.dependency_formats(LOCAL_CRATE);
let formats = tcx.dependency_formats(());
let deps = formats.iter().find_map(|(t, list)| (*t == crate_type).then_some(list)).unwrap();
for (index, dep_format) in deps.iter().enumerate() {

View file

@ -511,7 +511,7 @@ pub fn codegen_crate<B: ExtraBackendMethods>(
// linkage, then it's already got an allocator shim and we'll be using that
// one instead. If nothing exists then it's our job to generate the
// allocator!
let any_dynamic_crate = tcx.dependency_formats(LOCAL_CRATE).iter().any(|(_, list)| {
let any_dynamic_crate = tcx.dependency_formats(()).iter().any(|(_, list)| {
use rustc_middle::middle::dependency_format::Linkage;
list.iter().any(|&linkage| linkage == Linkage::Dynamic)
});
@ -768,7 +768,7 @@ impl CrateInfo {
used_crate_source: Default::default(),
lang_item_to_crate: Default::default(),
missing_lang_items: Default::default(),
dependency_formats: tcx.dependency_formats(LOCAL_CRATE),
dependency_formats: tcx.dependency_formats(()),
};
let lang_items = tcx.lang_items();