about summary refs log tree commit diff
path: root/compiler/rustc_const_eval/src/interpret
diff options
context:
space:
mode:
authorGeorge Bateman <george.bateman16@gmail.com>2023-08-15 20:10:45 +0100
committerGeorge Bateman <george.bateman16@gmail.com>2023-10-31 23:25:54 +0000
commite936416a8d3cfb501504f00d7250d5b595fed244 (patch)
treec0dd8196372db8a77ae1a90d38d87b630658e90e /compiler/rustc_const_eval/src/interpret
parent9d83ac217957eece2189eccf4a7232caec7232ee (diff)
downloadrust-e936416a8d3cfb501504f00d7250d5b595fed244.tar.gz
rust-e936416a8d3cfb501504f00d7250d5b595fed244.zip
Support enum variants in offset_of!
Diffstat (limited to 'compiler/rustc_const_eval/src/interpret')
-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 8c34d05042b..b6993d939c5 100644
--- a/compiler/rustc_const_eval/src/interpret/step.rs
+++ b/compiler/rustc_const_eval/src/interpret/step.rs
@@ -275,7 +275,7 @@ impl<'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> InterpCx<'mir, 'tcx, M> {
                     mir::NullOp::SizeOf => layout.size.bytes(),
                     mir::NullOp::AlignOf => layout.align.abi.bytes(),
                     mir::NullOp::OffsetOf(fields) => {
-                        layout.offset_of_subfield(self, fields.iter().map(|f| f.index())).bytes()
+                        layout.offset_of_subfield(self, fields.iter()).bytes()
                     }
                 };
                 self.write_scalar(Scalar::from_target_usize(val, self), &dest)?;