Update upstream_monomorphizations and upstream_monomorphizations_for
This commit is contained in:
parent
99f6221bb6
commit
95dfd82666
@ -60,6 +60,13 @@ macro_rules! arena_types {
|
||||
>,
|
||||
[few] crate_inherent_impls: rustc::ty::CrateInherentImpls,
|
||||
[decode] borrowck: rustc::middle::borrowck::BorrowCheckResult,
|
||||
[few] upstream_monomorphizations:
|
||||
rustc::util::nodemap::DefIdMap<
|
||||
rustc_data_structures::fx::FxHashMap<
|
||||
rustc::ty::subst::SubstsRef<'tcx>,
|
||||
rustc::hir::def_id::CrateNum
|
||||
>
|
||||
>,
|
||||
], $tcx);
|
||||
)
|
||||
}
|
||||
|
@ -681,11 +681,11 @@ rustc_queries! {
|
||||
Codegen {
|
||||
query upstream_monomorphizations(
|
||||
k: CrateNum
|
||||
) -> Lrc<DefIdMap<Lrc<FxHashMap<SubstsRef<'tcx>, CrateNum>>>> {
|
||||
) -> &'tcx DefIdMap<FxHashMap<SubstsRef<'tcx>, CrateNum>> {
|
||||
desc { "collecting available upstream monomorphizations `{:?}`", k }
|
||||
}
|
||||
query upstream_monomorphizations_for(_: DefId)
|
||||
-> Option<Lrc<FxHashMap<SubstsRef<'tcx>, CrateNum>>> {}
|
||||
-> Option<&'tcx FxHashMap<SubstsRef<'tcx>, CrateNum>> {}
|
||||
}
|
||||
|
||||
Other {
|
||||
|
@ -282,7 +282,7 @@ fn exported_symbols_provider_local<'a, 'tcx>(tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
fn upstream_monomorphizations_provider<'a, 'tcx>(
|
||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
cnum: CrateNum)
|
||||
-> Lrc<DefIdMap<Lrc<FxHashMap<SubstsRef<'tcx>, CrateNum>>>>
|
||||
-> &'tcx DefIdMap<FxHashMap<SubstsRef<'tcx>, CrateNum>>
|
||||
{
|
||||
debug_assert!(cnum == LOCAL_CRATE);
|
||||
|
||||
@ -326,20 +326,16 @@ fn upstream_monomorphizations_provider<'a, 'tcx>(
|
||||
}
|
||||
}
|
||||
|
||||
Lrc::new(instances.into_iter()
|
||||
.map(|(key, value)| (key, Lrc::new(value)))
|
||||
.collect())
|
||||
tcx.arena.alloc(instances)
|
||||
}
|
||||
|
||||
fn upstream_monomorphizations_for_provider<'a, 'tcx>(
|
||||
tcx: TyCtxt<'a, 'tcx, 'tcx>,
|
||||
def_id: DefId)
|
||||
-> Option<Lrc<FxHashMap<SubstsRef<'tcx>, CrateNum>>>
|
||||
-> Option<&'tcx FxHashMap<SubstsRef<'tcx>, CrateNum>>
|
||||
{
|
||||
debug_assert!(!def_id.is_local());
|
||||
tcx.upstream_monomorphizations(LOCAL_CRATE)
|
||||
.get(&def_id)
|
||||
.cloned()
|
||||
tcx.upstream_monomorphizations(LOCAL_CRATE).get(&def_id)
|
||||
}
|
||||
|
||||
fn is_unreachable_local_definition_provider(tcx: TyCtxt<'_, '_, '_>, def_id: DefId) -> bool {
|
||||
|
Loading…
Reference in New Issue
Block a user