1
Fork 0

Rollup merge of #125508 - scottmcm:fix-125506, r=Nilstrieb

Stop SRoA'ing `DynMetadata` in MIR

Fixes #125506
This commit is contained in:
Matthias Krüger 2024-05-26 13:43:07 +02:00 committed by GitHub
commit 5fef6c511d
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 24 additions and 0 deletions

View file

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