@@ -633,21 +633,24 @@ fn characteristic_def_id_of_mono_item<'tcx>(
633
633
match mono_item {
634
634
MonoItem :: Fn ( instance) => {
635
635
let def_id = match instance. def {
636
- ty:: InstanceKind :: Item ( def ) => def ,
637
- ty:: InstanceKind :: VTableShim ( ..)
636
+ ty:: InstanceKind :: Item ( .. )
637
+ | ty:: InstanceKind :: VTableShim ( ..)
638
638
| ty:: InstanceKind :: ReifyShim ( ..)
639
- | ty:: InstanceKind :: FnPtrShim ( ..)
639
+ | ty:: InstanceKind :: Virtual ( ..)
640
640
| ty:: InstanceKind :: ClosureOnceShim { .. }
641
641
| ty:: InstanceKind :: ConstructCoroutineInClosureShim { .. }
642
- | ty:: InstanceKind :: Intrinsic ( ..)
643
- | ty:: InstanceKind :: DropGlue ( ..)
644
- | ty:: InstanceKind :: Virtual ( ..)
645
- | ty:: InstanceKind :: CloneShim ( ..)
646
- | ty:: InstanceKind :: ThreadLocalShim ( ..)
642
+ | ty:: InstanceKind :: CloneShim ( ..) => instance. def_id ( ) ,
643
+ ty:: InstanceKind :: ThreadLocalShim ( def_id) => def_id,
644
+ ty:: InstanceKind :: Intrinsic ( ..)
645
+ | ty:: InstanceKind :: FnPtrShim ( ..)
647
646
| ty:: InstanceKind :: FnPtrAddrShim ( ..)
648
647
| ty:: InstanceKind :: FutureDropPollShim ( ..)
649
648
| ty:: InstanceKind :: AsyncDropGlue ( ..)
650
- | ty:: InstanceKind :: AsyncDropGlueCtorShim ( ..) => return None ,
649
+ | ty:: InstanceKind :: AsyncDropGlueCtorShim ( ..)
650
+ | ty:: InstanceKind :: DropGlue ( _, None ) => return None ,
651
+ ty:: InstanceKind :: DropGlue ( _, Some ( ty) ) => {
652
+ return characteristic_def_id_of_type ( ty) ;
653
+ }
651
654
} ;
652
655
653
656
// If this is a method, we want to put it into the same module as
@@ -661,17 +664,6 @@ fn characteristic_def_id_of_mono_item<'tcx>(
661
664
}
662
665
663
666
if let Some ( impl_def_id) = tcx. impl_of_method ( def_id) {
664
- if tcx. sess . opts . incremental . is_some ( )
665
- && tcx
666
- . trait_id_of_impl ( impl_def_id)
667
- . is_some_and ( |def_id| tcx. is_lang_item ( def_id, LangItem :: Drop ) )
668
- {
669
- // Put `Drop::drop` into the same cgu as `drop_in_place`
670
- // since `drop_in_place` is the only thing that can
671
- // call it.
672
- return None ;
673
- }
674
-
675
667
// This is a method within an impl, find out what the self-type is:
676
668
let impl_self_ty = tcx. instantiate_and_normalize_erasing_regions (
677
669
instance. args ,
0 commit comments