about summary refs log tree commit diff
path: root/compiler/rustc_codegen_cranelift/src/base.rs
diff options
context:
space:
mode:
authorRalf Jung <post@ralfj.de>2024-06-08 11:26:56 +0200
committerRalf Jung <post@ralfj.de>2024-06-08 18:17:55 +0200
commiteb584a23bfba55512af0a223cf4133b806ede178 (patch)
treefecadfa0fdf6d7c1ecf085e65294c156e96de5fd /compiler/rustc_codegen_cranelift/src/base.rs
parent16e8803579e5914a17a4924f47faaefc040a982d (diff)
downloadrust-eb584a23bfba55512af0a223cf4133b806ede178.tar.gz
rust-eb584a23bfba55512af0a223cf4133b806ede178.zip
offset_of: allow (unstably) taking the offset of slice tail fields
Diffstat (limited to 'compiler/rustc_codegen_cranelift/src/base.rs')
-rw-r--r--compiler/rustc_codegen_cranelift/src/base.rs7
1 files changed, 4 insertions, 3 deletions
diff --git a/compiler/rustc_codegen_cranelift/src/base.rs b/compiler/rustc_codegen_cranelift/src/base.rs
index 963e5de91ce..6d26ca0b899 100644
--- a/compiler/rustc_codegen_cranelift/src/base.rs
+++ b/compiler/rustc_codegen_cranelift/src/base.rs
@@ -832,9 +832,10 @@ fn codegen_stmt<'tcx>(
                     let val = match null_op {
                         NullOp::SizeOf => layout.size.bytes(),
                         NullOp::AlignOf => layout.align.abi.bytes(),
-                        NullOp::OffsetOf(fields) => {
-                            layout.offset_of_subfield(fx, fields.iter()).bytes()
-                        }
+                        NullOp::OffsetOf(fields) => fx
+                            .tcx
+                            .offset_of_subfield(ParamEnv::reveal_all(), layout, fields.iter())
+                            .bytes(),
                         NullOp::UbChecks => {
                             let val = fx.tcx.sess.ub_checks();
                             let val = CValue::by_val(