about summary refs log tree commit diff
path: root/compiler/rustc_codegen_ssa/src
diff options
context:
space:
mode:
authorbors <bors@rust-lang.org>2025-06-05 00:30:08 +0000
committerbors <bors@rust-lang.org>2025-06-05 00:30:08 +0000
commit81a964c23ea4fe9ab52b4449bb166bf280035797 (patch)
treef125374c699b8fed4c7ec8971ae9c2496b772d15 /compiler/rustc_codegen_ssa/src
parentff223d35cd684f8c7c07ed4b7fd4475e482359ab (diff)
parent4959ee314d220688de394ea7ab3f25f2788ca17b (diff)
downloadrust-81a964c23ea4fe9ab52b4449bb166bf280035797.tar.gz
rust-81a964c23ea4fe9ab52b4449bb166bf280035797.zip
Auto merge of #142033 - matthiaskrgr:rollup-99lvg0j, r=matthiaskrgr
Rollup of 11 pull requests

Successful merges:

 - rust-lang/rust#141890 (Add link to correct documentation in htmldocck.py)
 - rust-lang/rust#141932 (Fix for async drop inside async gen fn)
 - rust-lang/rust#141960 (Use non-2015 edition paths in tests that do not test for their resolution)
 - rust-lang/rust#141968 (Run wfcheck in one big loop instead of per module)
 - rust-lang/rust#141969 (Triagebot: Remove `assign.users_on_vacation`)
 - rust-lang/rust#141985 (Ensure query keys are printed with reduced queries)
 - rust-lang/rust#141999 (Visit the ident in `PreciseCapturingNonLifetimeArg`.)
 - rust-lang/rust#142005 (Change `tag_field` to `FieldIdx` in `Variants::Multiple`)
 - rust-lang/rust#142017 (Fix incorrect use of "recommend" over "recommended")
 - rust-lang/rust#142024 (Don't refer to 'this tail expression' in expansion.)
 - rust-lang/rust#142025 (Don't refer to 'local binding' in extern macro.)

r? `@ghost`
`@rustbot` modify labels: rollup
Diffstat (limited to 'compiler/rustc_codegen_ssa/src')
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/operand.rs4
-rw-r--r--compiler/rustc_codegen_ssa/src/mir/place.rs4
2 files changed, 4 insertions, 4 deletions
diff --git a/compiler/rustc_codegen_ssa/src/mir/operand.rs b/compiler/rustc_codegen_ssa/src/mir/operand.rs
index eade9e52de9..b7f2277bfda 100644
--- a/compiler/rustc_codegen_ssa/src/mir/operand.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/operand.rs
@@ -462,10 +462,10 @@ impl<'a, 'tcx, V: CodegenObject> OperandRef<'tcx, V> {
         let tag_op = match self.val {
             OperandValue::ZeroSized => bug!(),
             OperandValue::Immediate(_) | OperandValue::Pair(_, _) => {
-                self.extract_field(fx, bx, tag_field)
+                self.extract_field(fx, bx, tag_field.as_usize())
             }
             OperandValue::Ref(place) => {
-                let tag = place.with_type(self.layout).project_field(bx, tag_field);
+                let tag = place.with_type(self.layout).project_field(bx, tag_field.as_usize());
                 bx.load_operand(tag)
             }
         };
diff --git a/compiler/rustc_codegen_ssa/src/mir/place.rs b/compiler/rustc_codegen_ssa/src/mir/place.rs
index 31db7fa9a18..937063c24a6 100644
--- a/compiler/rustc_codegen_ssa/src/mir/place.rs
+++ b/compiler/rustc_codegen_ssa/src/mir/place.rs
@@ -250,7 +250,7 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
             Variants::Single { index } => assert_eq!(index, variant_index),
 
             Variants::Multiple { tag_encoding: TagEncoding::Direct, tag_field, .. } => {
-                let ptr = self.project_field(bx, tag_field);
+                let ptr = self.project_field(bx, tag_field.as_usize());
                 let to =
                     self.layout.ty.discriminant_for_variant(bx.tcx(), variant_index).unwrap().val;
                 bx.store_to_place(
@@ -265,7 +265,7 @@ impl<'a, 'tcx, V: CodegenObject> PlaceRef<'tcx, V> {
                 ..
             } => {
                 if variant_index != untagged_variant {
-                    let niche = self.project_field(bx, tag_field);
+                    let niche = self.project_field(bx, tag_field.as_usize());
                     let niche_llty = bx.cx().immediate_backend_type(niche.layout);
                     let BackendRepr::Scalar(scalar) = niche.layout.backend_repr else {
                         bug!("expected a scalar placeref for the niche");