about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2024-05-18 17:20:48 +0000
committerbors <bors@rust-lang.org>2024-05-18 17:20:48 +0000
commitc00957a3e269219413041a4e3565f33b1f9d0779 (patch)
tree79187d51c27bb36b149e152eaeeea05a9e4b4b01 /compiler/rustc_codegen_ssa/src
parentcf2baaa8350c9cac9a5bc139926bcb246303b9f8 (diff)
parentcd1ca14c4860ced5790d1fd00bbdb9424478b72e (diff)
Auto merge of #125254 - matthiaskrgr:rollup-ukvsxbc, r=matthiaskrgr
Rollup of 4 pull requests

Successful merges:

 - #125117 (Improve parser)
 - #125184 (Fix ICE in non-operand `aggregate_raw_ptr` intrinsic codegen)
 - #125240 (Temporarily revert to NonZeroUsize in rustc-abi to fix building on stable)
 - #125248 (Migrate `run-make/rustdoc-scrape-examples-invalid-expr` to `rmake.rs`)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/rvalue.rs6
1 files changed, 5 insertions, 1 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
index 936ed41a294..ff176a79675 100644
--- a/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/rvalue.rs
@@ -121,7 +121,11 @@ impl<'a, 'tcx, Bx: BuilderMethods<'a, 'tcx>> FunctionCx<'a, 'tcx, Bx> {
                 bx.write_operand_repeatedly(cg_elem, count, dest);
             }
 
-            mir::Rvalue::Aggregate(ref kind, ref operands) => {
+            // This implementation does field projection, so never use it for `RawPtr`,
+            // which will always be fine with the `codegen_rvalue_operand` path below.
+            mir::Rvalue::Aggregate(ref kind, ref operands)
+                if !matches!(**kind, mir::AggregateKind::RawPtr(..)) =>
+            {
                 let (variant_index, variant_dest, active_field_index) = match **kind {
                     mir::AggregateKind::Adt(_, variant_index, _, _, active_field_index) => {
                         let variant_dest = dest.project_downcast(bx, variant_index);