Skip to content

Commit 1caff8e

Browse files
committed
Stop SRoA'ing DynMetadata in MIR
1 parent 213ad10 commit 1caff8e

File tree

1 file changed

+5
-0
lines changed
  • compiler/rustc_mir_transform/src

1 file changed

+5
-0
lines changed

compiler/rustc_mir_transform/src/sroa.rs

+5
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,11 @@ fn escaping_locals<'tcx>(
7070
// Exclude #[repr(simd)] types so that they are not de-optimized into an array
7171
return true;
7272
}
73+
if Some(def.did()) == tcx.lang_items().dyn_metadata() {
74+
// codegen wants to see the `DynMetadata<T>`,
75+
// not the inner reference-to-opaque-type.
76+
return true;
77+
}
7378
// We already excluded unions and enums, so this ADT must have one variant
7479
let variant = def.variant(FIRST_VARIANT);
7580
if variant.fields.len() > 1 {

0 commit comments

Comments
 (0)