1
Fork 0

Handle calls to upstream monomorphizations in compiler_builtins

This commit is contained in:
Ben Kimock 2024-03-15 14:13:11 -04:00
parent 1ca424ca43
commit 5f4f2526b8
12 changed files with 95 additions and 9 deletions

View file

@ -1020,7 +1020,7 @@ fn visit_instance_use<'tcx>(
/// Returns `true` if we should codegen an instance in the local crate, or returns `false` if we
/// can just link to the upstream crate and therefore don't need a mono item.
fn should_codegen_locally<'tcx>(tcx: TyCtxt<'tcx>, instance: &Instance<'tcx>) -> bool {
pub(crate) fn should_codegen_locally<'tcx>(tcx: TyCtxt<'tcx>, instance: &Instance<'tcx>) -> bool {
let Some(def_id) = instance.def.def_id_if_not_guaranteed_local_codegen() else {
return true;
};