Skip to content

Commit

Permalink
Polymorphization is gone
Browse files Browse the repository at this point in the history
  • Loading branch information
nbdd0121 committed Dec 8, 2024
1 parent 25bc709 commit b55a642
Showing 1 changed file with 2 additions and 7 deletions.
9 changes: 2 additions & 7 deletions src/monomorphize_collector.rs
Original file line number Diff line number Diff line change
Expand Up @@ -785,12 +785,7 @@ pub fn should_codegen_locally<'tcx>(tcx: TyCtxt<'tcx>, instance: &Instance<'tcx>
return true;
}

if tcx.is_reachable_non_generic(def_id)
|| instance
.polymorphize(tcx)
.upstream_monomorphization(tcx)
.is_some()
{
if tcx.is_reachable_non_generic(def_id) || instance.upstream_monomorphization(tcx).is_some() {
// We can link to the item in question, no instance needed in this crate.
return false;
}
Expand Down Expand Up @@ -926,7 +921,7 @@ fn create_fn_mono_item<'tcx>(
instance: Instance<'tcx>,
source: Span,
) -> Spanned<MonoItem<'tcx>> {
respan(source, MonoItem::Fn(instance.polymorphize(tcx)))
respan(source, MonoItem::Fn(instance))
}

/// Creates a `MonoItem` for each method that is referenced by the vtable for
Expand Down

0 comments on commit b55a642

Please sign in to comment.