about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret/step.rs
diff options
context:
space:
mode:
authorScott McMurray <scottmcm@users.noreply.github.com>2025-06-04 01:44:40 -0700
committerScott McMurray <scottmcm@users.noreply.github.com>2025-06-05 19:15:56 -0700
commit8bce2255e826a11d1aa345d1786f85d22c5f921a (patch)
treec90edaa44e96973f9ac1bab06c7d770d0be58edf /compiler/rustc_const_eval/src/interpret/step.rs
parentccf3198de316b488ee17441935182e9d5292b4d3 (diff)
downloadrust-8bce2255e826a11d1aa345d1786f85d22c5f921a.tar.gz
rust-8bce2255e826a11d1aa345d1786f85d22c5f921a.zip
Update `InterpCx::project_field` to take `FieldIdx`
As suggested by Ralf in 142005.

Diffstat (limited to 'compiler/rustc_const_eval/src/interpret/step.rs')
-rw-r--r--compiler/rustc_const_eval/src/interpret/step.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/rustc_const_eval/src/interpret/step.rs b/compiler/rustc_const_eval/src/interpret/step.rs
index 975325b0c1e..833fcc38817 100644
--- a/compiler/rustc_const_eval/src/interpret/step.rs
+++ b/compiler/rustc_const_eval/src/interpret/step.rs
@@ -333,7 +333,7 @@ impl<'tcx, M: Machine<'tcx>> InterpCx<'tcx, M> {
         }
         for (field_index, operand) in operands.iter_enumerated() {
             let field_index = active_field_index.unwrap_or(field_index);
-            let field_dest = self.project_field(&variant_dest, field_index.as_usize())?;
+            let field_dest = self.project_field(&variant_dest, field_index)?;
             let op = self.eval_operand(operand, Some(field_dest.layout))?;
             self.copy_op(&op, &field_dest)?;
         }