diff options
| author | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-03-06 19:13:46 -0800 |
|---|---|---|
| committer | Scott McMurray <scottmcm@users.noreply.github.com> | 2025-07-20 10:22:09 -0700 |
| commit | 41ce1ed252f194756fb2f3e3e92bbdfb3940088d (patch) | |
| tree | 6d723fea3a43e0424cb4575ce2c2b80bd5a77120 /compiler/rustc_codegen_ssa | |
| parent | f790042c6ab3cf05622e63928b13cb802d68fadf (diff) | |
| download | rust-41ce1ed252f194756fb2f3e3e92bbdfb3940088d.tar.gz rust-41ce1ed252f194756fb2f3e3e92bbdfb3940088d.zip | |
Ban projecting into SIMD types [MCP838]
Diffstat (limited to 'compiler/rustc_codegen_ssa')
| -rw-r--r-- | compiler/rustc_codegen_ssa/src/mir/operand.rs | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/operand.rs b/compiler/rustc_codegen_ssa/src/mir/operand.rs index 6a3fdb6ede1..06bedaaa4a2 100644 --- a/compiler/rustc_codegen_ssa/src/mir/operand.rs +++ b/compiler/rustc_codegen_ssa/src/mir/operand.rs @@ -329,20 +329,11 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> { let offset = self.layout.fields.offset(i); if !bx.is_backend_ref(self.layout) && bx.is_backend_ref(field) { - if let BackendRepr::SimdVector { count, .. } = self.layout.backend_repr - && let BackendRepr::Memory { sized: true } = field.backend_repr - && count.is_power_of_two() - { - assert_eq!(field.size, self.layout.size); - // This is being deprecated, but for now stdarch still needs it for - // Newtype vector of array, e.g. #[repr(simd)] struct S([i32; 4]); - let place = PlaceRef::alloca(bx, field); - self.val.store(bx, place.val.with_type(self.layout)); - return bx.load_operand(place); - } else { - // Part of https://github.com/rust-lang/compiler-team/issues/838 - bug!("Non-ref type {self:?} cannot project to ref field type {field:?}"); - } + // Part of https://github.com/rust-lang/compiler-team/issues/838 + span_bug!( + fx.mir.span, + "Non-ref type {self:?} cannot project to ref field type {field:?}", + ); } let val = if field.is_zst() { |
