diff --git a/src/monomorphize_collector.rs b/src/monomorphize_collector.rs index 8c59228..7ea14bb 100644 --- a/src/monomorphize_collector.rs +++ b/src/monomorphize_collector.rs @@ -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; } @@ -926,7 +921,7 @@ fn create_fn_mono_item<'tcx>( instance: Instance<'tcx>, source: Span, ) -> Spanned> { - 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