offset_of: allow (unstably) taking the offset of slice tail fields
This commit is contained in:
parent
5d0ec8d162
commit
6210c26a5a
@ -832,9 +832,10 @@ fn codegen_stmt<'tcx>(
|
|||||||
let val = match null_op {
|
let val = match null_op {
|
||||||
NullOp::SizeOf => layout.size.bytes(),
|
NullOp::SizeOf => layout.size.bytes(),
|
||||||
NullOp::AlignOf => layout.align.abi.bytes(),
|
NullOp::AlignOf => layout.align.abi.bytes(),
|
||||||
NullOp::OffsetOf(fields) => {
|
NullOp::OffsetOf(fields) => fx
|
||||||
layout.offset_of_subfield(fx, fields.iter()).bytes()
|
.tcx
|
||||||
}
|
.offset_of_subfield(ParamEnv::reveal_all(), layout, fields.iter())
|
||||||
|
.bytes(),
|
||||||
NullOp::UbChecks => {
|
NullOp::UbChecks => {
|
||||||
let val = fx.tcx.sess.ub_checks();
|
let val = fx.tcx.sess.ub_checks();
|
||||||
let val = CValue::by_val(
|
let val = CValue::by_val(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user