Rollup merge of #80983 - bjorn3:no_dup_is_dllimport_foreign_item, r=nagisa
Remove is_dllimport_foreign_item definition from cg_ssa It overwrites the definition from rustc_metadata. cc https://rust-lang.zulipchat.com/#narrow/stream/182449-t-compiler.2Fhelp/topic/query.20provided.20twice/near/218927806 Marked as draft to test if this breaks anything.
This commit is contained in:
commit
8f2ee87965
@ -29,7 +29,6 @@ use rustc_middle::ty::query::Providers;
|
|||||||
use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
|
use rustc_middle::ty::{self, Instance, Ty, TyCtxt};
|
||||||
use rustc_session::cgu_reuse_tracker::CguReuse;
|
use rustc_session::cgu_reuse_tracker::CguReuse;
|
||||||
use rustc_session::config::{self, EntryFnType};
|
use rustc_session::config::{self, EntryFnType};
|
||||||
use rustc_session::utils::NativeLibKind;
|
|
||||||
use rustc_session::Session;
|
use rustc_session::Session;
|
||||||
use rustc_target::abi::{Align, LayoutOf, VariantIdx};
|
use rustc_target::abi::{Align, LayoutOf, VariantIdx};
|
||||||
|
|
||||||
@ -817,32 +816,6 @@ pub fn provide_both(providers: &mut Providers) {
|
|||||||
}
|
}
|
||||||
tcx.sess.opts.optimize
|
tcx.sess.opts.optimize
|
||||||
};
|
};
|
||||||
|
|
||||||
providers.dllimport_foreign_items = |tcx, krate| {
|
|
||||||
let module_map = tcx.foreign_modules(krate);
|
|
||||||
|
|
||||||
let dllimports = tcx
|
|
||||||
.native_libraries(krate)
|
|
||||||
.iter()
|
|
||||||
.filter(|lib| {
|
|
||||||
if !matches!(lib.kind, NativeLibKind::Dylib | NativeLibKind::Unspecified) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
let cfg = match lib.cfg {
|
|
||||||
Some(ref cfg) => cfg,
|
|
||||||
None => return true,
|
|
||||||
};
|
|
||||||
attr::cfg_matches(cfg, &tcx.sess.parse_sess, None)
|
|
||||||
})
|
|
||||||
.filter_map(|lib| lib.foreign_module)
|
|
||||||
.map(|id| &module_map[&id])
|
|
||||||
.flat_map(|module| module.foreign_items.iter().cloned())
|
|
||||||
.collect();
|
|
||||||
dllimports
|
|
||||||
};
|
|
||||||
|
|
||||||
providers.is_dllimport_foreign_item =
|
|
||||||
|tcx, def_id| tcx.dllimport_foreign_items(def_id.krate).contains(&def_id);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
fn determine_cgu_reuse<'tcx>(tcx: TyCtxt<'tcx>, cgu: &CodegenUnit<'tcx>) -> CguReuse {
|
fn determine_cgu_reuse<'tcx>(tcx: TyCtxt<'tcx>, cgu: &CodegenUnit<'tcx>) -> CguReuse {
|
||||||
|
@ -1281,11 +1281,6 @@ rustc_queries! {
|
|||||||
}
|
}
|
||||||
|
|
||||||
Other {
|
Other {
|
||||||
query dllimport_foreign_items(_: CrateNum)
|
|
||||||
-> FxHashSet<DefId> {
|
|
||||||
storage(ArenaCacheSelector<'tcx>)
|
|
||||||
desc { "dllimport_foreign_items" }
|
|
||||||
}
|
|
||||||
query is_dllimport_foreign_item(def_id: DefId) -> bool {
|
query is_dllimport_foreign_item(def_id: DefId) -> bool {
|
||||||
desc { |tcx| "is_dllimport_foreign_item({})", tcx.def_path_str(def_id) }
|
desc { |tcx| "is_dllimport_foreign_item({})", tcx.def_path_str(def_id) }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user