about summary refs log tree commit diff
path: root/compiler/rustc_mir_transform/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-07-31 08:54:41 +0000
committerbors <bors@rust-lang.org>2025-07-31 08:54:41 +0000
commit64ca23b6235732fa61c0a2b957c5d7e591e7c972 (patch)
tree4688ea8f1bef26095df721f0a4344b64e2e66f03 /compiler/rustc_mir_transform/src
parentcc0a5b73053c62a3df5f84b3ee85079c9b65fa87 (diff)
parent017586c93abe3b7e6f495a1f2bf34df4f3693411 (diff)
downloadrust-64ca23b6235732fa61c0a2b957c5d7e591e7c972.tar.gz
rust-64ca23b6235732fa61c0a2b957c5d7e591e7c972.zip
Auto merge of #144723 - Zalathar:rollup-f9e0rfo, r=Zalathar
Rollup of 3 pull requests

Successful merges:

 - rust-lang/rust#144657 (fix: Only "close the window" when its the last annotated file)
 - rust-lang/rust#144665 (Re-block SRoA on SIMD types)
 - rust-lang/rust#144713 (`rustc_middle::ty` cleanups)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_mir_transform/src')
-rw-r--r--compiler/rustc_mir_transform/src/sroa.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_mir_transform/src/sroa.rs b/compiler/rustc_mir_transform/src/sroa.rs
index 80c4b58a574..38769885f36 100644
--- a/compiler/rustc_mir_transform/src/sroa.rs
+++ b/compiler/rustc_mir_transform/src/sroa.rs
@@ -72,8 +72,12 @@ fn escaping_locals<'tcx>(
             return true;
         }
         if let ty::Adt(def, _args) = ty.kind()
-            && tcx.is_lang_item(def.did(), LangItem::DynMetadata)
+            && (def.repr().simd() || tcx.is_lang_item(def.did(), LangItem::DynMetadata))
         {
+            // Exclude #[repr(simd)] types so that they are not de-optimized into an array
+            // (MCP#838 banned projections into SIMD types, but if the value is unused
+            // this pass sees "all the uses are of the fields" and expands it.)
+
             // codegen wants to see the `DynMetadata<T>`,
             // not the inner reference-to-opaque-type.
             return true;