Skip to content

Commit 01c9c97

Browse files
committed
Auto merge of #141560 - compiler-errors:incr-more-characteristic, r=<try>
[PERF] partition shims into CGU of their characteristic types, if possible We throw all non-`InstanceKind::Item` mono items into the same fallback CGU. What happens to incremental codegen if we didn't do that, but tried a bit harder to partition shims into the same CGU as their characteristic types? r? `@ghost`
2 parents 283db70 + 8ce6e6e commit 01c9c97

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

compiler/rustc_monomorphize/src/partitioning.rs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -633,16 +633,16 @@ fn characteristic_def_id_of_mono_item<'tcx>(
633633
match mono_item {
634634
MonoItem::Fn(instance) => {
635635
let def_id = match instance.def {
636-
ty::InstanceKind::Item(def) => def,
637-
ty::InstanceKind::VTableShim(..)
636+
ty::InstanceKind::Item(..)
637+
| ty::InstanceKind::VTableShim(..)
638638
| ty::InstanceKind::ReifyShim(..)
639-
| ty::InstanceKind::FnPtrShim(..)
639+
| ty::InstanceKind::Virtual(..)
640640
| ty::InstanceKind::ClosureOnceShim { .. }
641641
| ty::InstanceKind::ConstructCoroutineInClosureShim { .. }
642-
| ty::InstanceKind::Intrinsic(..)
643642
| ty::InstanceKind::DropGlue(..)
644-
| ty::InstanceKind::Virtual(..)
645-
| ty::InstanceKind::CloneShim(..)
643+
| ty::InstanceKind::CloneShim(..) => instance.def_id(),
644+
ty::InstanceKind::Intrinsic(..)
645+
| ty::InstanceKind::FnPtrShim(..)
646646
| ty::InstanceKind::ThreadLocalShim(..)
647647
| ty::InstanceKind::FnPtrAddrShim(..)
648648
| ty::InstanceKind::FutureDropPollShim(..)

0 commit comments

Comments
 (0)